Option
Option is an item backed by an <option> element for use inside a ComboBox or List. It suppresses framework positioning styles so the browser renders the option natively.
Usage
typescript
import { ComboBox, Option } from '@jimka/typescript-ui/component/input';
const role = ComboBox();
role.addItem(Option('admin', 'Admin'));
role.addItem(Option('user', 'User'));
role.addItem(Option('guest', 'Guest'));The constructor takes (key, value):
- key — programmatic identifier; what
comboBox.getValue()returns. - value — display text shown in the dropdown.
Common methods
| Method | Purpose |
|---|---|
getKey() / setKey(key) | Programmatic value. |
getValue() / setValue(value) | Display text. |
Notes
Optionis not the same asListItem. UseOptionforComboBox/Listitems; useListItemforBulletedList/NumberedListitems.- For store-backed combo boxes, you don't construct
Optioninstances yourself — callcomboBox.setStoreinstead.
See also
- API: Option
ComboBox,List— typical consumersListItem— forBulletedList/NumberedList