View as Markdown

API reference: @salmonui/dropdowns/select

SelectMultiplePropsinterface

import type { SelectMultipleProps } from '@salmonui/dropdowns/select';
interface SelectMultipleProps<Item> extends SelectOwnProps<Item> {
    readonly multiple: true;
    readonly value?: readonly DropdownValue[];
    readonly defaultValue?: readonly DropdownValue[];
    readonly onValueChange?: (value: readonly DropdownValue[], event: DropdownValueChangeEvent<Item>) => void;
}
SelectMultipleProps members (72, 68 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.

searchableoptionalinheritedsearchable?: boolean;

A search input inside the popup filters the options.

searchPlaceholderoptionalinheritedsearchPlaceholder?: string;
onSearchChangeoptionalinheritedonSearchChange?: ((text: string, event: DropdownSearchChangeEvent) => void);
valueDisplayoptionalinheritedvalueDisplay?: "count" | "text";

How the selected values of multiple show in the trigger: joined labels (default) or a count. Chips are a Combobox multiple display.

refoptionalinheritedref?: Ref<HTMLButtonElement>;

The trigger <button role="combobox">.