ListItem
ListItem is a single list item backed by a <li> element. Stores a key/value pair and suppresses framework positioning styles so the browser can render the item natively inside a list.
ListItem is used inside BulletedList and NumberedList.
Usage
typescript
import { BulletedList, ListItem } from '@jimka/typescript-ui/component/list';
const list = BulletedList();
list.addItem(ListItem('apple', 'Apple'));
list.addItem(ListItem('banana', 'Banana'));
list.addItem(ListItem('cherry', 'Cherry'));
panel.addComponent(list);Common methods
| Method | Purpose |
|---|---|
getKey() / setKey(key) | Programmatic key. |
getValue() / setValue(value) | Display text. |
Notes
ListItemis not the same asOption. UseOptionfor items inside aComboBoxorList; useListItemfor items inside aBulletedList/NumberedList.
See also
- API: ListItem
BulletedList,NumberedList— typical containersOption— forComboBox/Listitems