API reference: @salmonui/dropdowns/listbox
ListboxMultiplePropsinterface
import type { ListboxMultipleProps } from '@salmonui/dropdowns/listbox';interface ListboxMultipleProps<T> extends ListboxBaseProps<T> {
readonly multiple: true;
readonly value?: readonly ListboxKey[];
readonly defaultValue?: readonly ListboxKey[];
readonly onValueChange?: (value: readonly ListboxKey[], event: ListboxValueChangeEvent<T>) => void;
}
Multiple selection.
| Name | Signature | Description |
|---|---|---|
multiple | readonly multiple: true; | |
valueoptional | readonly value?: readonly ListboxKey[]; | |
defaultValueoptional | readonly defaultValue?: readonly ListboxKey[]; | |
onValueChangeoptional | readonly onValueChange?: (value: readonly ListboxKey[], event: ListboxValueChangeEvent<T>) => void; | |
datainherited | data: ListboxDataSource<T> | readonly T[]; | Items (an array, never copied), or a remote |
getItemValueoptionalinherited | getItemValue?: ((item: T) => ListboxKey); | Default: a primitive is its own value; objects read |
getItemLabeloptionalinherited | getItemLabel?: ((item: T) => string); | Default: a primitive is its own label; objects read |
getItemGroupoptionalinherited | getItemGroup?: ((item: T) => string | null | undefined); | Default: objects read |
getItemIconoptionalinherited | getItemIcon?: ((item: T) => ReactNode); | |
isItemDisabledoptionalinherited | isItemDisabled?: ((item: T) => boolean); | Default: objects read |
layoutoptionalinherited | layout?: "grid" | "list"; |
|
columnsoptionalinherited | columns?: number; | Items per row with |
indicatoroptionalinherited | indicator?: "check" | "checkbox"; | Marker of selected options. Default |
indicatorPositionoptionalinherited | indicatorPosition?: "end" | "start"; | Side of the marker: |
showSelectAlloptionalinherited | showSelectAll?: boolean; | Tri-state "select all" checkbox above the list ( |
maxSelectedoptionalinherited | maxSelected?: number; | Most values |
searchableoptionalinherited | searchable?: boolean; | A search field above the list filters it. |
searchOperatoroptionalinherited | searchOperator?: ListboxSearchOperator<T>; | Default |
matchCaseoptionalinherited | matchCase?: boolean; | |
ignoreAccentsoptionalinherited | ignoreAccents?: boolean; | |
searchPlaceholderoptionalinherited | searchPlaceholder?: string; | |
onSearchChangeoptionalinherited | onSearchChange?: ((event: { readonly text: string; }) => void); | Fires when the search text changes. |
debounceoptionalinherited | debounce?: number; | Remote search debounce in ms. Default 300; local data filters on every keystroke. |
minSearchLengthoptionalinherited | minSearchLength?: number; | Remote: searches shorter than this send no request. |
maxResultsoptionalinherited | maxResults?: number; | Caps the number of listed items. |
queryoptionalinherited | query?: ListboxQuery; | Remote: base filters and sort merged into every read. |
searchFieldsoptionalinherited | searchFields?: readonly string[]; | Remote: fields the search text runs over. Default |
virtualizationoptionalinherited | virtualization?: boolean; | Virtual list (fixed item height). Default: on above 100 items. |
maxVisibleItemsoptionalinherited | maxVisibleItems?: number; | List height in items. Default 8. |
highlightMatchesoptionalinherited | highlightMatches?: boolean; | Mark the search text in labels ( |
renderItemoptionalinherited | renderItem?: ((state: ListboxItemState<T>) => ReactNode); | |
renderGroupHeaderoptionalinherited | renderGroupHeader?: ((state: { readonly group: string; }) => ReactNode); | |
renderEmptyoptionalinherited | renderEmpty?: ((state: { readonly reason: "noData" | "noMatch"; }) => ReactNode); | |
renderErroroptionalinherited | renderError?: ((state: { readonly error: unknown; readonly retry: () => void; }) => ReactNode); | |
renderLoadingoptionalinherited | renderLoading?: (() => ReactNode); | |
getItemPropsoptionalinherited | getItemProps?: ((item: T, state: { readonly selected: boolean; readonly disabled: boolean; }) => ListboxItemProps | undefined); | |
onLoadErroroptionalinherited | onLoadError?: ((error: unknown) => void); | Remote: called when a read fails. |
loadingoptionalinherited | loading?: boolean; | Forces the busy state ( |
nameoptionalinherited | name?: string; | Form field name: renders a hidden native |
requiredoptionalinherited | required?: boolean; | |
formoptionalinherited | form?: string; | |
disabledoptionalinherited | disabled?: boolean; | |
readOnlyoptionalinherited | readOnly?: boolean; | |
reorderableoptionalinherited | reorderable?: boolean; | Alt+Up / Alt+Down and drag within the list fire |
onReorderoptionalinherited | onReorder?: ((event: ListboxReorderEvent<T>) => void); | |
dragGroupoptionalinherited | dragGroup?: string; | Lists with the same group accept each other's items by drag and drop. |
onItemDragStartoptionalinherited | onItemDragStart?: ((event: ListboxDragStartEvent<T>) => void); | |
onItemDragoptionalinherited | onItemDrag?: ((event: ListboxDragEvent) => void); | |
onItemDropoptionalinherited | onItemDrop?: ((event: ListboxDropEvent<T>) => void); | |
localeTextoptionalinherited | localeText?: Partial<ListboxLocaleText>; | |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
classNamesoptionalinherited | classNames?: Partial<Record<ListboxPart, string>>; | |
stylesoptionalinherited | styles?: Partial<Record<ListboxPart, CSSProperties>>; | |
refoptionalinherited | ref?: Ref<HTMLDivElement>; | The focusable |