API reference: @salmonui/dropdowns/select
SelectSinglePropsinterface
import type { SelectSingleProps } from '@salmonui/dropdowns/select';interface SelectSingleProps<Item> extends SelectOwnProps<Item> {
readonly multiple?: false;
readonly value?: DropdownValue | null;
readonly defaultValue?: DropdownValue | null;
readonly onValueChange?: (value: DropdownValue | null, event: DropdownValueChangeEvent<Item>) => void;
}
| Name | Signature | Description |
|---|---|---|
multipleoptional | readonly multiple?: false; | |
valueoptional | readonly value?: DropdownValue | null; | Selected value; |
defaultValueoptional | readonly defaultValue?: DropdownValue | null; | |
onValueChangeoptional | readonly onValueChange?: (value: DropdownValue | null, event: DropdownValueChangeEvent<Item>) => void; | |
datainherited | data: readonly Item[] | RemoteSource<Item>; | Items (objects or primitives) or an |
getItemValueoptionalinherited | getItemValue?: ((item: Item) => CollectionKey); | |
getItemLabeloptionalinherited | getItemLabel?: ((item: Item) => string); | |
getItemGroupoptionalinherited | getItemGroup?: ((item: Item) => string | null | undefined); | |
getItemIconoptionalinherited | getItemIcon?: ((item: Item) => ReactNode); | |
isItemDisabledoptionalinherited | isItemDisabled?: ((item: Item) => boolean); | |
selectedItemsoptionalinherited | selectedItems?: readonly Item[]; | Items of the current value that are not in loaded |
openoptionalinherited | open?: boolean; | |
defaultOpenoptionalinherited | defaultOpen?: boolean; | |
onOpenChangeoptionalinherited | onOpenChange?: ((open: boolean, event: DropdownOpenChangeEvent) => void); | |
searchOperatoroptionalinherited | searchOperator?: SearchOperator<Item>; | |
matchCaseoptionalinherited | matchCase?: boolean; | Case-sensitive search. Default |
ignoreAccentsoptionalinherited | ignoreAccents?: boolean; | Diacritics-insensitive search. Default |
debounceoptionalinherited | debounce?: number; | Remote search delay in ms (local data filters on every keystroke). Default 300. |
minSearchLengthoptionalinherited | minSearchLength?: number; | |
maxResultsoptionalinherited | maxResults?: number; | |
searchFieldsoptionalinherited | searchFields?: readonly string[]; | Fields searched by a remote source ( |
queryoptionalinherited | query?: RemoteQuery; | Base query merged into every remote read. |
virtualizationoptionalinherited | virtualization?: boolean; | Windowed list; |
maxVisibleItemsoptionalinherited | maxVisibleItems?: number; | Popup height in items. Default 8. |
popupModeoptionalinherited | popupMode?: "auto" | "popover" | "sheet"; |
|
clearableoptionalinherited | clearable?: boolean; | |
placeholderoptionalinherited | placeholder?: string; | |
disabledoptionalinherited | disabled?: boolean; | |
readOnlyoptionalinherited | readOnly?: boolean; | |
nameoptionalinherited | name?: string; | |
requiredoptionalinherited | required?: boolean; | |
formoptionalinherited | form?: string; | |
idoptionalinherited | id?: string; | |
autoFocusoptionalinherited | autoFocus?: boolean; | |
indicatoroptionalinherited | indicator?: "check" | "checkbox"; | |
showSelectAlloptionalinherited | showSelectAll?: boolean; | |
maxSelectedoptionalinherited | maxSelected?: number; | |
groupSelectionoptionalinherited | groupSelection?: boolean; | |
hideSelectedoptionalinherited | hideSelected?: boolean; | |
closeOnSelectoptionalinherited | closeOnSelect?: boolean; | |
maxVisibleValuesoptionalinherited | maxVisibleValues?: number; | |
valueSeparatoroptionalinherited | valueSeparator?: string; | Separator of |
localeoptionalinherited | locale?: string; | BCP 47 locale for list and plural formatting. Default |
renderItemoptionalinherited | renderItem?: ((props: DropdownItemRenderProps<Item>) => ReactNode); | |
renderValueoptionalinherited | renderValue?: ((props: { readonly items: readonly Item[]; readonly labels: readonly string[]; }) => ReactNode); | |
renderChipoptionalinherited | renderChip?: ((props: DropdownChipRenderProps<Item>) => ReactNode); | |
renderGroupHeaderoptionalinherited | renderGroupHeader?: ((props: { readonly group: string; }) => ReactNode); | |
renderEmptyoptionalinherited | renderEmpty?: ((props: { readonly reason: "noData" | "noMatch"; }) => ReactNode); | |
renderErroroptionalinherited | renderError?: ((props: { readonly error: unknown; readonly retry: () => void; }) => ReactNode); | |
renderLoadingoptionalinherited | renderLoading?: (() => ReactNode); | |
popupHeaderoptionalinherited | popupHeader?: ReactNode; | |
popupFooteroptionalinherited | popupFooter?: ReactNode; | |
getItemPropsoptionalinherited | getItemProps?: ((item: Item) => DropdownPartProps | undefined); | |
getChipPropsoptionalinherited | getChipProps?: ((item: Item) => DropdownPartProps | undefined); | |
highlightMatchesoptionalinherited | highlightMatches?: boolean; | Marks the matched characters with |
loadingoptionalinherited | loading?: boolean; | Forces the loading state (set automatically while a remote read is pending). |
onLoadErroroptionalinherited | onLoadError?: ((error: unknown) => void); | |
sizeoptionalinherited | size?: "lg" | "md" | "sm"; | Control size: |
localeTextoptionalinherited | localeText?: Partial<DropdownLocaleText>; | |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
classNamesoptionalinherited | classNames?: Partial<Record<DropdownPart, string>>; | |
stylesoptionalinherited | styles?: Partial<Record<DropdownPart, CSSProperties>>; | |
labeloptionalinherited | label?: ReactNode; | Visible label above the control; names it through |
descriptionoptionalinherited | description?: ReactNode; | Help text below the control, referenced by |
errorMessageoptionalinherited | errorMessage?: ReactNode; | Error text below the control, shown while |
invalidoptionalinherited | invalid?: boolean; | Marks the control invalid: |
searchableoptionalinherited | searchable?: boolean; | A search input inside the popup filters the options. |
searchPlaceholderoptionalinherited | searchPlaceholder?: string; | |
onSearchChangeoptionalinherited | onSearchChange?: ((text: string, event: DropdownSearchChangeEvent) => void); | |
valueDisplayoptionalinherited | valueDisplay?: "count" | "text"; | How the selected values of |
refoptionalinherited | ref?: Ref<HTMLButtonElement>; | The trigger |