# ListboxBaseProps (@salmonui/dropdowns/listbox)

> The ListboxBaseProps interface of @salmonui/dropdowns/listbox: Props shared by single and multiple Listbox.

Canonical: https://salmonui.dev/docs/reference/dropdowns/listbox/ListboxBaseProps

```ts
import type { ListboxBaseProps } from '@salmonui/dropdowns/listbox';
```

Entry index: https://salmonui.dev/docs/reference/dropdowns/listbox (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/dropdowns/listbox.md).

## Reference

Kind: interface

```ts
interface ListboxBaseProps<T> extends ListboxDomProps {
    readonly data: readonly T[] | ListboxDataSource<T>;
    readonly getItemValue?: (item: T) => ListboxKey;
    readonly getItemLabel?: (item: T) => string;
    readonly getItemGroup?: (item: T) => string | null | undefined;
    readonly getItemIcon?: (item: T) => ReactNode;
    readonly isItemDisabled?: (item: T) => boolean;
    readonly layout?: 'list' | 'grid';
    readonly columns?: number;
    readonly indicator?: 'check' | 'checkbox';
    readonly indicatorPosition?: 'start' | 'end';
    readonly showSelectAll?: boolean;
    readonly maxSelected?: number;
    readonly searchable?: boolean;
    readonly searchOperator?: ListboxSearchOperator<T>;
    readonly matchCase?: boolean;
    readonly ignoreAccents?: boolean;
    readonly searchPlaceholder?: string;
    readonly onSearchChange?: (event: {
        readonly text: string;
    }) => void;
    readonly debounce?: number;
    readonly minSearchLength?: number;
    readonly maxResults?: number;
    readonly query?: ListboxQuery;
    readonly searchFields?: readonly string[];
    readonly virtualization?: boolean;
    readonly maxVisibleItems?: number;
    readonly highlightMatches?: boolean;
    readonly renderItem?: (state: ListboxItemState<T>) => ReactNode;
    readonly renderGroupHeader?: (state: {
        readonly group: string;
    }) => ReactNode;
    readonly renderEmpty?: (state: {
        readonly reason: 'noData' | 'noMatch';
    }) => ReactNode;
    readonly renderError?: (state: {
        readonly error: unknown;
        readonly retry: () => void;
    }) => ReactNode;
    readonly renderLoading?: () => ReactNode;
    readonly getItemProps?: (item: T, state: {
        readonly selected: boolean;
        readonly disabled: boolean;
    }) => ListboxItemProps | undefined;
    readonly onLoadError?: (error: unknown) => void;
    readonly loading?: boolean;
    readonly name?: string;
    readonly required?: boolean;
    readonly form?: string;
    readonly disabled?: boolean;
    readonly readOnly?: boolean;
    readonly reorderable?: boolean;
    readonly onReorder?: (event: ListboxReorderEvent<T>) => void;
    readonly dragGroup?: string;
    readonly onItemDragStart?: (event: ListboxDragStartEvent<T>) => void;
    readonly onItemDrag?: (event: ListboxDragEvent) => void;
    readonly onItemDrop?: (event: ListboxDropEvent<T>) => void;
    readonly localeText?: Partial<ListboxLocaleText>;
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly classNames?: Partial<Record<ListboxPart, string>>;
    readonly styles?: Partial<Record<ListboxPart, CSSProperties>>;
    readonly ref?: Ref<HTMLDivElement>;
}
```

Props shared by single and multiple `Listbox`.

Members (51):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data: readonly T[] \| ListboxDataSource<T>;` |  | Items (an array, never copied), or a remote `@salmonui/data` source. |
| `getItemValue` | `readonly getItemValue?: (item: T) => ListboxKey;` | optional | Default: a primitive is its own value; objects read `value`. Keep accessors stable (module scope or `useCallback`). |
| `getItemLabel` | `readonly getItemLabel?: (item: T) => string;` | optional | Default: a primitive is its own label; objects read `label`. |
| `getItemGroup` | `readonly getItemGroup?: (item: T) => string \| null \| undefined;` | optional | Default: objects read `group`. Items of one group must be contiguous. |
| `getItemIcon` | `readonly getItemIcon?: (item: T) => ReactNode;` | optional |  |
| `isItemDisabled` | `readonly isItemDisabled?: (item: T) => boolean;` | optional | Default: objects read `disabled`. Evaluated on render (reactive). |
| `layout` | `readonly layout?: 'list' \| 'grid';` | optional | `'grid'`: the APG Grid pattern (`role="grid"`, rows of `columns` cells) for items holding their own controls, and tile galleries. Tab and the arrow keys reach the active cell's controls; selection does not follow focus. No group headers or reordering. Default `'list'`. |
| `columns` | `readonly columns?: number;` | optional | Items per row with `layout="grid"`. Default 1. |
| `indicator` | `readonly indicator?: 'check' \| 'checkbox';` | optional | Marker of selected options. Default `'check'`. |
| `indicatorPosition` | `readonly indicatorPosition?: 'start' \| 'end';` | optional | Side of the marker: `'start'` (default) or `'end'`, logical so it mirrors in RTL. |
| `showSelectAll` | `readonly showSelectAll?: boolean;` | optional | Tri-state "select all" checkbox above the list (`multiple`). |
| `maxSelected` | `readonly maxSelected?: number;` | optional | Most values `multiple` may hold; further options become unavailable. |
| `searchable` | `readonly searchable?: boolean;` | optional | A search field above the list filters it. |
| `searchOperator` | `readonly searchOperator?: ListboxSearchOperator<T>;` | optional | Default `'startsWith'`. |
| `matchCase` | `readonly matchCase?: boolean;` | optional |  |
| `ignoreAccents` | `readonly ignoreAccents?: boolean;` | optional |  |
| `searchPlaceholder` | `readonly searchPlaceholder?: string;` | optional |  |
| `onSearchChange` | `readonly onSearchChange?: (event: {     readonly text: string; }) => void;` | optional | Fires when the search text changes. |
| `debounce` | `readonly debounce?: number;` | optional | Remote search debounce in ms. Default 300; local data filters on every keystroke. |
| `minSearchLength` | `readonly minSearchLength?: number;` | optional | Remote: searches shorter than this send no request. |
| `maxResults` | `readonly maxResults?: number;` | optional | Caps the number of listed items. |
| `query` | `readonly query?: ListboxQuery;` | optional | Remote: base filters and sort merged into every read. |
| `searchFields` | `readonly searchFields?: readonly string[];` | optional | Remote: fields the search text runs over. Default `['label']`. |
| `virtualization` | `readonly virtualization?: boolean;` | optional | Virtual list (fixed item height). Default: on above 100 items. |
| `maxVisibleItems` | `readonly maxVisibleItems?: number;` | optional | List height in items. Default 8. |
| `highlightMatches` | `readonly highlightMatches?: boolean;` | optional | Mark the search text in labels (`<mark>`). |
| `renderItem` | `readonly renderItem?: (state: ListboxItemState<T>) => ReactNode;` | optional |  |
| `renderGroupHeader` | `readonly renderGroupHeader?: (state: {     readonly group: string; }) => ReactNode;` | optional |  |
| `renderEmpty` | `readonly renderEmpty?: (state: {     readonly reason: 'noData' \| 'noMatch'; }) => ReactNode;` | optional |  |
| `renderError` | `readonly renderError?: (state: {     readonly error: unknown;     readonly retry: () => void; }) => ReactNode;` | optional |  |
| `renderLoading` | `readonly renderLoading?: () => ReactNode;` | optional |  |
| `getItemProps` | `readonly getItemProps?: (item: T, state: {     readonly selected: boolean;     readonly disabled: boolean; }) => ListboxItemProps \| undefined;` | optional |  |
| `onLoadError` | `readonly onLoadError?: (error: unknown) => void;` | optional | Remote: called when a read fails. |
| `loading` | `readonly loading?: boolean;` | optional | Forces the busy state (`aria-busy`); set automatically while a remote read is pending. |
| `name` | `readonly name?: string;` | optional | Form field name: renders a hidden native `<select>` that submits the value. |
| `required` | `readonly required?: boolean;` | optional |  |
| `form` | `readonly form?: string;` | optional |  |
| `disabled` | `readonly disabled?: boolean;` | optional |  |
| `readOnly` | `readonly readOnly?: boolean;` | optional |  |
| `reorderable` | `readonly reorderable?: boolean;` | optional | Alt+Up / Alt+Down and drag within the list fire `onReorder`. |
| `onReorder` | `readonly onReorder?: (event: ListboxReorderEvent<T>) => void;` | optional |  |
| `dragGroup` | `readonly dragGroup?: string;` | optional | Lists with the same group accept each other's items by drag and drop. |
| `onItemDragStart` | `readonly onItemDragStart?: (event: ListboxDragStartEvent<T>) => void;` | optional |  |
| `onItemDrag` | `readonly onItemDrag?: (event: ListboxDragEvent) => void;` | optional |  |
| `onItemDrop` | `readonly onItemDrop?: (event: ListboxDropEvent<T>) => void;` | optional |  |
| `localeText` | `readonly localeText?: Partial<ListboxLocaleText>;` | optional |  |
| `className` | `readonly className?: string;` | optional |  |
| `style` | `readonly style?: CSSProperties;` | optional |  |
| `classNames` | `readonly classNames?: Partial<Record<ListboxPart, string>>;` | optional |  |
| `styles` | `readonly styles?: Partial<Record<ListboxPart, CSSProperties>>;` | optional |  |
| `ref` | `readonly ref?: Ref<HTMLDivElement>;` | optional | The focusable `role="listbox"` (or `role="grid"` with `layout="grid"`) element. |
