Combobox API
import { Combobox } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
allowCustom | boolean | |
autofocus | boolean | |
children | React.ReactNode | |
clearable | boolean | |
debounce | number | |
defaultValue | string | Starting value of an uncontrolled combobox (written once, on mount). |
description | string | |
disabled | boolean | |
emptyText | string | |
label | string | |
maxlength | number | |
name | string | |
noFilter | boolean | |
onChange | (value: string) => void | |
onClear | () => void | |
onClose | () => void | |
onCloseDetail | (detail: { open: boolean; previousOpen: boolean; source: string }) => void | |
onDebouncedInput | (query: string) => void | |
onInput | (query: string) => void | |
onOpen | () => void | |
onOpenDetail | (detail: { open: boolean; previousOpen: boolean; source: string }) => void | |
onSelect | (value: string, label: string) => void | |
open | boolean | |
placeholder | string | |
radius | 'none' | 'large' | 'full' | string | |
readOnly | boolean | |
required | boolean | |
size | 'sm' | 'md' | 'lg' | '1' | '2' | '3' | |
state | 'idle' | 'loading' | 'error' | 'success' | |
stateText | string | |
validation | 'error' | 'success' | 'none' | |
value | string | The selected value. With onChange/onSelect it is controlled: a pick the parent rejects is undone. |
variant | 'classic' | 'surface' | 'soft' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Combobox.Option props
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode | |
description | string |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-combobox>
Combobox renders the ui-combobox custom element from @editora/ui-core, which can also be used without React.
Attributes: allow-custom, aria-describedby, aria-description, aria-label, autofocus, clearable, debounce, description, disabled, empty-text, headless, label, maxlength, name, no-filter, open, placeholder, radius, readonly, required, size, state, state-text, validation, value, variant
Events: change, clear, debounced-input, input, select