View as Markdown

API reference: @salmonui/dropdowns/combobox

ComboboxMultiplePropsinterface

import type { ComboboxMultipleProps } from '@salmonui/dropdowns/combobox';
interface ComboboxMultipleProps<Item> extends ComboboxOwnProps<Item> {
    readonly multiple: true;
    readonly value?: readonly DropdownValue[];
    readonly defaultValue?: readonly DropdownValue[];
    readonly onValueChange?: (value: readonly DropdownValue[], event: DropdownValueChangeEvent<Item>) => void;
}
ComboboxMultipleProps members (82, 78 inherited)
NameSignatureDescription
multiplereadonly multiple: true;
valueoptionalreadonly value?: readonly DropdownValue[];
defaultValueoptionalreadonly defaultValue?: readonly DropdownValue[];
onValueChangeoptionalreadonly onValueChange?: (value: readonly DropdownValue[], event: DropdownValueChangeEvent<Item>) => void;
datainheriteddata: readonly Item[] | RemoteSource<Item>;

Items (objects or primitives) or an @salmonui/data source.

getItemValueoptionalinheritedgetItemValue?: ((item: Item) => CollectionKey);
getItemLabeloptionalinheritedgetItemLabel?: ((item: Item) => string);
getItemGroupoptionalinheritedgetItemGroup?: ((item: Item) => string | null | undefined);
getItemIconoptionalinheritedgetItemIcon?: ((item: Item) => ReactNode);
isItemDisabledoptionalinheritedisItemDisabled?: ((item: Item) => boolean);
selectedItemsoptionalinheritedselectedItems?: readonly Item[];

Items of the current value that are not in loaded data (remote data, server labels).

openoptionalinheritedopen?: boolean;
defaultOpenoptionalinheriteddefaultOpen?: boolean;
onOpenChangeoptionalinheritedonOpenChange?: ((open: boolean, event: DropdownOpenChangeEvent) => void);
searchOperatoroptionalinheritedsearchOperator?: SearchOperator<Item>;
matchCaseoptionalinheritedmatchCase?: boolean;

Case-sensitive search. Default false.

ignoreAccentsoptionalinheritedignoreAccents?: boolean;

Diacritics-insensitive search. Default false.

debounceoptionalinheriteddebounce?: number;

Remote search delay in ms (local data filters on every keystroke). Default 300.

minSearchLengthoptionalinheritedminSearchLength?: number;
maxResultsoptionalinheritedmaxResults?: number;
searchFieldsoptionalinheritedsearchFields?: readonly string[];

Fields searched by a remote source (query.search.columnIds); default every field.

queryoptionalinheritedquery?: RemoteQuery;

Base query merged into every remote read.

virtualizationoptionalinheritedvirtualization?: boolean;

Windowed list; true by default above 100 items.

maxVisibleItemsoptionalinheritedmaxVisibleItems?: number;

Popup height in items. Default 8.

popupModeoptionalinheritedpopupMode?: "auto" | "popover" | "sheet";

'popover' (default) anchors the popup; 'sheet' is a full-screen dialog; 'auto' picks the sheet on coarse-pointer phones at open time.

clearableoptionalinheritedclearable?: boolean;
placeholderoptionalinheritedplaceholder?: string;
disabledoptionalinheriteddisabled?: boolean;
readOnlyoptionalinheritedreadOnly?: boolean;
nameoptionalinheritedname?: string;
requiredoptionalinheritedrequired?: boolean;
formoptionalinheritedform?: string;
idoptionalinheritedid?: string;
autoFocusoptionalinheritedautoFocus?: boolean;
indicatoroptionalinheritedindicator?: "check" | "checkbox";
showSelectAlloptionalinheritedshowSelectAll?: boolean;
maxSelectedoptionalinheritedmaxSelected?: number;
groupSelectionoptionalinheritedgroupSelection?: boolean;
hideSelectedoptionalinheritedhideSelected?: boolean;
closeOnSelectoptionalinheritedcloseOnSelect?: boolean;
maxVisibleValuesoptionalinheritedmaxVisibleValues?: number;
valueSeparatoroptionalinheritedvalueSeparator?: string;

Separator of valueDisplay="text"; default Intl.ListFormat of locale.

localeoptionalinheritedlocale?: string;

BCP 47 locale for list and plural formatting. Default 'en-US' (identical on server and client).

renderItemoptionalinheritedrenderItem?: ((props: DropdownItemRenderProps<Item>) => ReactNode);
renderValueoptionalinheritedrenderValue?: ((props: { readonly items: readonly Item[]; readonly labels: readonly string[]; }) => ReactNode);
renderChipoptionalinheritedrenderChip?: ((props: DropdownChipRenderProps<Item>) => ReactNode);
renderGroupHeaderoptionalinheritedrenderGroupHeader?: ((props: { readonly group: string; }) => ReactNode);
renderEmptyoptionalinheritedrenderEmpty?: ((props: { readonly reason: "noData" | "noMatch"; }) => ReactNode);
renderErroroptionalinheritedrenderError?: ((props: { readonly error: unknown; readonly retry: () => void; }) => ReactNode);
renderLoadingoptionalinheritedrenderLoading?: (() => ReactNode);
popupHeaderoptionalinheritedpopupHeader?: ReactNode;
popupFooteroptionalinheritedpopupFooter?: ReactNode;
getItemPropsoptionalinheritedgetItemProps?: ((item: Item) => DropdownPartProps | undefined);
getChipPropsoptionalinheritedgetChipProps?: ((item: Item) => DropdownPartProps | undefined);
highlightMatchesoptionalinheritedhighlightMatches?: boolean;

Marks the matched characters with <mark>.

loadingoptionalinheritedloading?: boolean;

Forces the loading state (set automatically while a remote read is pending).

onLoadErroroptionalinheritedonLoadError?: ((error: unknown) => void);
sizeoptionalinheritedsize?: "lg" | "md" | "sm";

Control size: 'sm' 24px, 'md' 32px (default), 'lg' 40px tall.

localeTextoptionalinheritedlocaleText?: Partial<DropdownLocaleText>;
classNameoptionalinheritedclassName?: string;
styleoptionalinheritedstyle?: CSSProperties;
classNamesoptionalinheritedclassNames?: Partial<Record<DropdownPart, string>>;
stylesoptionalinheritedstyles?: Partial<Record<DropdownPart, CSSProperties>>;
labeloptionalinheritedlabel?: ReactNode;

Visible label above the control; names it through aria-labelledby (an explicit aria-labelledby prop wins).

descriptionoptionalinheriteddescription?: ReactNode;

Help text below the control, referenced by aria-describedby.

errorMessageoptionalinheritederrorMessage?: ReactNode;

Error text below the control, shown while invalid.

invalidoptionalinheritedinvalid?: boolean;

Marks the control invalid: aria-invalid, data-invalid and the visible errorMessage.

inputValueoptionalinheritedinputValue?: string;

Text of the input (reactive); onInputChange reports every edit.

defaultInputValueoptionalinheriteddefaultInputValue?: string;
onInputChangeoptionalinheritedonInputChange?: ((text: string, event: ComboboxInputChangeEvent) => void);
creatableoptionalinheritedcreatable?: boolean;

Committed text without a matching item becomes the value. Default false.

onCreateItemoptionalinheritedonCreateItem?: ((text: string) => Item | null);

Builds the item for created text; null rejects it. Default: the text itself.

autofilloptionalinheritedautofill?: boolean;

Completes the first match inline (aria-autocomplete="both").

showTriggeroptionalinheritedshowTrigger?: boolean;

The dropdown button (not in the tab order). Default true.

openOnClickoptionalinheritedopenOnClick?: boolean;

A click in the input opens the popup. Default true.

commitOnBluroptionalinheritedcommitOnBlur?: boolean;

Typed text is committed (created) when focus leaves.

columnsoptionalinheritedcolumns?: readonly ComboboxColumn<Item>[];

Table popup (MultiColumn ComboBox): a lightweight role="grid".

rowHeightoptionalinheritedrowHeight?: number;

Fixed row height of the columns popup in px.

gridLinesoptionalinheritedgridLines?: "both" | "default" | "horizontal" | "none" | "vertical";
stripedoptionalinheritedstriped?: boolean;
sortingoptionalinheritedsorting?: boolean | ComboboxSort;

Header sorting of the columns popup. Default true.

refoptionalinheritedref?: Ref<HTMLInputElement>;

The <input role="combobox">.