@aria-ui/listbox
Listbox
ListboxElement
A custom Listbox element.
Properties: ListboxProps
new ListboxElement(props?: Partial<ListboxProps>): ListboxElement
ListboxProps
Property | Type | Description |
---|
onKeydownHandlerAdd | null | (handler : (event : KeyboardEvent ) => void ) => VoidFunction | By default, the Listbox element will listen for keydown events. However, you can pass onKeydownHandlerAdd to override the default behavior.
onKeydownHandlerAdd receives a keydown handler when the Listbox element is mounted, and returns a function that will be called when the Listbox element is unmounted.
Default
null |
onValueChange | null | (value : string ) => void | Event handler called when the value changes.
Default
null |
selectionMode | "multiple" | "single" | Listbox selection mode
Default
"single" |
value | string | The selected value.
Default
"" |
useListbox()
function useListbox(
element: ConnectableElement,
props?: Partial<ListboxProps>,
): SingalState<Readonly<ListboxProps>>;
ListboxItem
ListboxItemElement
A custom ListboxItem element.
Properties: ListboxItemProps
new ListboxItemElement(props?: Partial<ListboxItemProps>): ListboxItemElement
ListboxItemProps
Property | Type | Description |
---|
filter | ListboxItemFilter | The filter function to determine if an item should be shown in the listbox.
Default
{@link defaultListboxItemFilter} |
query | string | The query string to filter the listbox items.
Default
"" |
value | string | The value of the item. Every item must have a unique value in the parent list.
Default
"" |
ListboxItemFilter()
type ListboxItemFilter: (options: Object) => boolean;
The filter function to determine if an item should be shown in the listbox.
defaultListboxItemFilter()
function defaultListboxItemFilter(options: Object): boolean;
A simple case-insensitive substring match filter.
useListboxItem()
function useListboxItem(
element: ConnectableElement,
props?: Partial<ListboxItemProps>,
): SingalState<Readonly<ListboxItemProps>>;