API reference: @salmonui/dropdowns/combobox
ComboboxSinglePropsinterface
import type { ComboboxSingleProps } from '@salmonui/dropdowns/combobox';interface ComboboxSingleProps<Item> extends ComboboxOwnProps<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; | |
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: |
inputValueoptionalinherited | inputValue?: string; | Text of the input (reactive); |
defaultInputValueoptionalinherited | defaultInputValue?: string; | |
onInputChangeoptionalinherited | onInputChange?: ((text: string, event: ComboboxInputChangeEvent) => void); | |
creatableoptionalinherited | creatable?: boolean; | Committed text without a matching item becomes the value. Default |
onCreateItemoptionalinherited | onCreateItem?: ((text: string) => Item | null); | Builds the item for created text; |
autofilloptionalinherited | autofill?: boolean; | Completes the first match inline ( |
showTriggeroptionalinherited | showTrigger?: boolean; | The dropdown button (not in the tab order). Default |
openOnClickoptionalinherited | openOnClick?: boolean; | A click in the input opens the popup. Default |
commitOnBluroptionalinherited | commitOnBlur?: boolean; | Typed text is committed (created) when focus leaves. |
columnsoptionalinherited | columns?: readonly ComboboxColumn<Item>[]; | Table popup (MultiColumn ComboBox): a lightweight |
rowHeightoptionalinherited | rowHeight?: number; | Fixed row height of the |
gridLinesoptionalinherited | gridLines?: "both" | "default" | "horizontal" | "none" | "vertical"; | |
stripedoptionalinherited | striped?: boolean; | |
sortingoptionalinherited | sorting?: boolean | ComboboxSort; | Header sorting of the |
refoptionalinherited | ref?: Ref<HTMLInputElement>; | The |