Combobox
Combobox<
T>(__namedParameters):Element
Defined in: src/components/controls/Combobox/Combobox.tsx:117
Single-value select with an editable input. Filters the option list as the
user types (built-in fuzzy matcher, configurable via filterFn), supports
controlled and uncontrolled modes, optional freeSolo typing, optional
creatable mode for adding new entries, and an loading state for async
data sources.
Type Parameters
T
T extends string = string
Parameters
__namedParameters
about?
string
accessKey?
string
aria-activedescendant?
string
Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
aria-atomic?
Booleanish
Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
aria-autocomplete?
"none" | "inline" | "both" | "list"
Indicates whether inputting text could trigger display of one or more predictions of the user’s intended value for an input and specifies how predictions would be presented if they are made.
aria-braillelabel?
string
Defines a string value that labels the current element, which is intended to be converted into Braille.
See
aria-label.
aria-brailleroledescription?
string
Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
See
aria-roledescription.
aria-busy?
Booleanish
aria-checked?
boolean | "mixed" | "false" | "true"
Indicates the current “checked” state of checkboxes, radio buttons, and other widgets.
See
- aria-pressed
- aria-selected.
aria-colcount?
number
Defines the total number of columns in a table, grid, or treegrid.
See
aria-colindex.
aria-colindex?
number
Defines an element’s column index or position with respect to the total number of columns within a table, grid, or treegrid.
See
- aria-colcount
- aria-colspan.
aria-colindextext?
string
Defines a human readable text alternative of aria-colindex.
See
aria-rowindextext.
aria-colspan?
number
Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
See
- aria-colindex
- aria-rowspan.
aria-controls?
string
Identifies the element (or elements) whose contents or presence are controlled by the current element.
See
aria-owns.
aria-current?
boolean | "location" | "page" | "false" | "true" | "step" | "date" | "time"
Indicates the element that represents the current item within a container or set of related elements.
aria-describedby?
string
Identifies the element (or elements) that describes the object.
See
aria-labelledby
aria-description?
string
Defines a string value that describes or annotates the current element.
See
related aria-describedby.
aria-details?
string
Identifies the element that provides a detailed, extended description for the object.
See
aria-describedby.
aria-disabled?
Booleanish
Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
See
- aria-hidden
- aria-readonly.
aria-dropeffect?
"none" | "link" | "copy" | "move" | "execute" | "popup"
Indicates what functions can be performed when a dragged object is released on the drop target.
aria-errormessage?
string
Identifies the element that provides an error message for the object.
See
- aria-invalid
- aria-describedby.
aria-expanded?
Booleanish
Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
aria-flowto?
string
Identifies the next element (or elements) in an alternate reading order of content which, at the user’s discretion, allows assistive technology to override the general default of reading in document source order.
aria-grabbed?
Booleanish
Indicates an element’s “grabbed” state in a drag-and-drop operation.
aria-haspopup?
boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree"
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
aria-hidden?
Booleanish
Indicates whether the element is exposed to an accessibility API.
See
aria-disabled.
aria-invalid?
boolean | "false" | "true" | "grammar" | "spelling"
Indicates the entered value does not conform to the format expected by the application.
See
aria-errormessage.
aria-keyshortcuts?
string
Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
aria-label?
string
Defines a string value that labels the current element.
See
aria-labelledby.
aria-labelledby?
string
Identifies the element (or elements) that labels the current element.
See
aria-describedby.
aria-level?
number
Defines the hierarchical level of an element within a structure.
aria-live?
"off" | "assertive" | "polite"
Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
aria-modal?
Booleanish
Indicates whether an element is modal when displayed.
aria-multiline?
Booleanish
Indicates whether a text box accepts multiple lines of input or only a single line.
aria-multiselectable?
Booleanish
Indicates that the user may select more than one item from the current selectable descendants.
aria-orientation?
"horizontal" | "vertical"
Indicates whether the element’s orientation is horizontal, vertical, or unknown/ambiguous.
aria-owns?
string
Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
See
aria-controls.
aria-placeholder?
string
Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
aria-posinset?
number
Defines an element’s number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
See
aria-setsize.
aria-pressed?
boolean | "mixed" | "false" | "true"
Indicates the current “pressed” state of toggle buttons.
See
- aria-checked
- aria-selected.
aria-readonly?
Booleanish
Indicates that the element is not editable, but is otherwise operable.
See
aria-disabled.
aria-relevant?
"text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"
Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
See
aria-atomic.
aria-required?
Booleanish
Indicates that user input is required on the element before a form may be submitted.
aria-roledescription?
string
Defines a human-readable, author-localized description for the role of an element.
aria-rowcount?
number
Defines the total number of rows in a table, grid, or treegrid.
See
aria-rowindex.
aria-rowindex?
number
Defines an element’s row index or position with respect to the total number of rows within a table, grid, or treegrid.
See
- aria-rowcount
- aria-rowspan.
aria-rowindextext?
string
Defines a human readable text alternative of aria-rowindex.
See
aria-colindextext.
aria-rowspan?
number
Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
See
- aria-rowindex
- aria-colspan.
aria-selected?
Booleanish
Indicates the current “selected” state of various widgets.
See
- aria-checked
- aria-pressed.
aria-setsize?
number
Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
See
aria-posinset.
aria-sort?
"none" | "ascending" | "descending" | "other"
Indicates if items in a table or grid are sorted in ascending or descending order.
aria-valuemax?
number
Defines the maximum allowed value for a range widget.
aria-valuemin?
number
Defines the minimum allowed value for a range widget.
aria-valuenow?
number
Defines the current value for a range widget.
See
aria-valuetext.
aria-valuetext?
string
Defines the human readable text alternative of aria-valuenow for a range widget.
autoCapitalize?
"none" | string & object | "off" | "on" | "sentences" | "words" | "characters"
autoCorrect?
string
autoFocus?
boolean
autoSave?
string
className?
string
Additional CSS class names
clearable?
boolean = false
Show a clear button when a value is selected
color?
string
content?
string
contentEditable?
"inherit" | Booleanish | "plaintext-only"
contextMenu?
string
creatable?
boolean = false
When true the user can create a brand new option by pressing Enter on a
value that doesn’t match any existing option. The onCreate callback (or
onChange when omitted) is invoked. Implies freeSolo.
Default
falsecreateLabel?
(query) => ReactNode
Render the “create” row when creatable is true and the query has no
exact match. Defaults to 'Create "<query>"'.
dangerouslySetInnerHTML?
{ __html: string | TrustedHTML; }
dangerouslySetInnerHTML.__html
string | TrustedHTML
datatype?
string
defaultChecked?
boolean
defaultValue?
T
Default selected value (uncontrolled)
dir?
string
disabled?
boolean = false
Disable the input
draggable?
Booleanish
emptyMessage?
string = 'No results found'
Message shown when filtering yields no results
enterKeyHint?
"search" | "next" | "enter" | "done" | "go" | "previous" | "send"
error?
boolean = false
Error state
errorMessage?
string
Error message — overrides helperText when error is true
exportparts?
string
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts
filterFn?
(option, query) => number | boolean
Custom filter function. Receives the raw query and the option, returns
either a boolean (true to keep) or a numeric score (higher = better).
When omitted, options are filtered by the built-in fuzzy matcher
(fuzzyScore).
freeSolo?
boolean = false
Allow values not present in options. The onChange handler still fires
with the user-typed string when the input is blurred or Enter is pressed
with no active suggestion.
Default
falsehelperText?
string
Helper text rendered below
hidden?
boolean
id?
string
Unique identifier for the component
inert?
boolean
See
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
inlist?
any
inputMode?
"text" | "none" | "search" | "tel" | "url" | "email" | "numeric" | "decimal"
Hints at the type of data that might be entered by the user while editing the element or its contents
See
https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
is?
string
Specify that a standard HTML element should behave like a defined custom built-in element
See
https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
itemID?
string
itemProp?
string
itemRef?
string
itemScope?
boolean
itemType?
string
label?
string
Label rendered above the input
lang?
string
loading?
boolean = false
Loading indicator state — replaces options with a spinner row
loadingMessage?
string = 'Loading...'
Message shown while loading
maxDropdownHeight?
number = 240
Maximum dropdown height in pixels
minDropdownWidth?
number
Minimum dropdown width in pixels
name?
string
Hidden form-input name
nonce?
string
onAbort?
ReactEventHandler<HTMLInputElement>
onAbortCapture?
ReactEventHandler<HTMLInputElement>
onAnimationEnd?
AnimationEventHandler<HTMLInputElement>
onAnimationEndCapture?
AnimationEventHandler<HTMLInputElement>
onAnimationIteration?
AnimationEventHandler<HTMLInputElement>
onAnimationIterationCapture?
AnimationEventHandler<HTMLInputElement>
onAnimationStart?
AnimationEventHandler<HTMLInputElement>
onAnimationStartCapture?
AnimationEventHandler<HTMLInputElement>
onAuxClick?
MouseEventHandler<HTMLInputElement>
onAuxClickCapture?
MouseEventHandler<HTMLInputElement>
onBeforeInput?
InputEventHandler<HTMLInputElement>
onBeforeInputCapture?
InputEventHandler<HTMLInputElement>
onBeforeToggle?
ToggleEventHandler<HTMLInputElement>
onBlur?
FocusEventHandler<HTMLInputElement>
onBlurCapture?
FocusEventHandler<HTMLInputElement>
onCanPlay?
ReactEventHandler<HTMLInputElement>
onCanPlayCapture?
ReactEventHandler<HTMLInputElement>
onCanPlayThrough?
ReactEventHandler<HTMLInputElement>
onCanPlayThroughCapture?
ReactEventHandler<HTMLInputElement>
onChange?
(value) => void
Selection change handler. null is passed when the value is cleared.
onChangeCapture?
ChangeEventHandler<HTMLInputElement, Element>
onClick?
MouseEventHandler<HTMLInputElement>
onClickCapture?
MouseEventHandler<HTMLInputElement>
onCompositionEnd?
CompositionEventHandler<HTMLInputElement>
onCompositionEndCapture?
CompositionEventHandler<HTMLInputElement>
onCompositionStart?
CompositionEventHandler<HTMLInputElement>
onCompositionStartCapture?
CompositionEventHandler<HTMLInputElement>
onCompositionUpdate?
CompositionEventHandler<HTMLInputElement>
onCompositionUpdateCapture?
CompositionEventHandler<HTMLInputElement>
onContextMenu?
MouseEventHandler<HTMLInputElement>
onContextMenuCapture?
MouseEventHandler<HTMLInputElement>
onCopy?
ClipboardEventHandler<HTMLInputElement>
onCopyCapture?
ClipboardEventHandler<HTMLInputElement>
onCreate?
(input) => void
Called when the user creates a new option (only when creatable is set).
Falls back to onChange with the typed string cast as T when omitted.
onCut?
ClipboardEventHandler<HTMLInputElement>
onCutCapture?
ClipboardEventHandler<HTMLInputElement>
onDoubleClick?
MouseEventHandler<HTMLInputElement>
onDoubleClickCapture?
MouseEventHandler<HTMLInputElement>
onDrag?
DragEventHandler<HTMLInputElement>
onDragCapture?
DragEventHandler<HTMLInputElement>
onDragEnd?
DragEventHandler<HTMLInputElement>
onDragEndCapture?
DragEventHandler<HTMLInputElement>
onDragEnter?
DragEventHandler<HTMLInputElement>
onDragEnterCapture?
DragEventHandler<HTMLInputElement>
onDragExit?
DragEventHandler<HTMLInputElement>
onDragExitCapture?
DragEventHandler<HTMLInputElement>
onDragLeave?
DragEventHandler<HTMLInputElement>
onDragLeaveCapture?
DragEventHandler<HTMLInputElement>
onDragOver?
DragEventHandler<HTMLInputElement>
onDragOverCapture?
DragEventHandler<HTMLInputElement>
onDragStart?
DragEventHandler<HTMLInputElement>
onDragStartCapture?
DragEventHandler<HTMLInputElement>
onDrop?
DragEventHandler<HTMLInputElement>
onDropCapture?
DragEventHandler<HTMLInputElement>
onDurationChange?
ReactEventHandler<HTMLInputElement>
onDurationChangeCapture?
ReactEventHandler<HTMLInputElement>
onEmptied?
ReactEventHandler<HTMLInputElement>
onEmptiedCapture?
ReactEventHandler<HTMLInputElement>
onEncrypted?
ReactEventHandler<HTMLInputElement>
onEncryptedCapture?
ReactEventHandler<HTMLInputElement>
onEnded?
ReactEventHandler<HTMLInputElement>
onEndedCapture?
ReactEventHandler<HTMLInputElement>
onError?
ReactEventHandler<HTMLInputElement>
onErrorCapture?
ReactEventHandler<HTMLInputElement>
onFocus?
FocusEventHandler<HTMLInputElement>
onFocusCapture?
FocusEventHandler<HTMLInputElement>
onGotPointerCapture?
PointerEventHandler<HTMLInputElement>
onGotPointerCaptureCapture?
PointerEventHandler<HTMLInputElement>
onInput?
InputEventHandler<HTMLInputElement>
onInputCapture?
InputEventHandler<HTMLInputElement>
onInputChange?
(input) => void
Free-text change handler. Fires every keystroke regardless of selection status. Useful for async option loading.
onInvalid?
ReactEventHandler<HTMLInputElement>
onInvalidCapture?
ReactEventHandler<HTMLInputElement>
onKeyDown?
KeyboardEventHandler<HTMLInputElement>
onKeyDownCapture?
KeyboardEventHandler<HTMLInputElement>
onKeyPress?
KeyboardEventHandler<HTMLInputElement>
onKeyPressCapture?
KeyboardEventHandler<HTMLInputElement>
onKeyUp?
KeyboardEventHandler<HTMLInputElement>
onKeyUpCapture?
KeyboardEventHandler<HTMLInputElement>
onLoad?
ReactEventHandler<HTMLInputElement>
onLoadCapture?
ReactEventHandler<HTMLInputElement>
onLoadedData?
ReactEventHandler<HTMLInputElement>
onLoadedDataCapture?
ReactEventHandler<HTMLInputElement>
onLoadedMetadata?
ReactEventHandler<HTMLInputElement>
onLoadedMetadataCapture?
ReactEventHandler<HTMLInputElement>
onLoadStart?
ReactEventHandler<HTMLInputElement>
onLoadStartCapture?
ReactEventHandler<HTMLInputElement>
onLostPointerCapture?
PointerEventHandler<HTMLInputElement>
onLostPointerCaptureCapture?
PointerEventHandler<HTMLInputElement>
onMouseDown?
MouseEventHandler<HTMLInputElement>
onMouseDownCapture?
MouseEventHandler<HTMLInputElement>
onMouseEnter?
MouseEventHandler<HTMLInputElement>
onMouseLeave?
MouseEventHandler<HTMLInputElement>
onMouseMove?
MouseEventHandler<HTMLInputElement>
onMouseMoveCapture?
MouseEventHandler<HTMLInputElement>
onMouseOut?
MouseEventHandler<HTMLInputElement>
onMouseOutCapture?
MouseEventHandler<HTMLInputElement>
onMouseOver?
MouseEventHandler<HTMLInputElement>
onMouseOverCapture?
MouseEventHandler<HTMLInputElement>
onMouseUp?
MouseEventHandler<HTMLInputElement>
onMouseUpCapture?
MouseEventHandler<HTMLInputElement>
onOpenChange?
(open) => void
Open state change handler
onPaste?
ClipboardEventHandler<HTMLInputElement>
onPasteCapture?
ClipboardEventHandler<HTMLInputElement>
onPause?
ReactEventHandler<HTMLInputElement>
onPauseCapture?
ReactEventHandler<HTMLInputElement>
onPlay?
ReactEventHandler<HTMLInputElement>
onPlayCapture?
ReactEventHandler<HTMLInputElement>
onPlaying?
ReactEventHandler<HTMLInputElement>
onPlayingCapture?
ReactEventHandler<HTMLInputElement>
onPointerCancel?
PointerEventHandler<HTMLInputElement>
onPointerCancelCapture?
PointerEventHandler<HTMLInputElement>
onPointerDown?
PointerEventHandler<HTMLInputElement>
onPointerDownCapture?
PointerEventHandler<HTMLInputElement>
onPointerEnter?
PointerEventHandler<HTMLInputElement>
onPointerLeave?
PointerEventHandler<HTMLInputElement>
onPointerMove?
PointerEventHandler<HTMLInputElement>
onPointerMoveCapture?
PointerEventHandler<HTMLInputElement>
onPointerOut?
PointerEventHandler<HTMLInputElement>
onPointerOutCapture?
PointerEventHandler<HTMLInputElement>
onPointerOver?
PointerEventHandler<HTMLInputElement>
onPointerOverCapture?
PointerEventHandler<HTMLInputElement>
onPointerUp?
PointerEventHandler<HTMLInputElement>
onPointerUpCapture?
PointerEventHandler<HTMLInputElement>
onProgress?
ReactEventHandler<HTMLInputElement>
onProgressCapture?
ReactEventHandler<HTMLInputElement>
onRateChange?
ReactEventHandler<HTMLInputElement>
onRateChangeCapture?
ReactEventHandler<HTMLInputElement>
onReset?
ReactEventHandler<HTMLInputElement>
onResetCapture?
ReactEventHandler<HTMLInputElement>
onScroll?
UIEventHandler<HTMLInputElement>
onScrollCapture?
UIEventHandler<HTMLInputElement>
onScrollEnd?
UIEventHandler<HTMLInputElement>
onScrollEndCapture?
UIEventHandler<HTMLInputElement>
onSeeked?
ReactEventHandler<HTMLInputElement>
onSeekedCapture?
ReactEventHandler<HTMLInputElement>
onSeeking?
ReactEventHandler<HTMLInputElement>
onSeekingCapture?
ReactEventHandler<HTMLInputElement>
onSelect?
ReactEventHandler<HTMLInputElement>
onSelectCapture?
ReactEventHandler<HTMLInputElement>
onStalled?
ReactEventHandler<HTMLInputElement>
onStalledCapture?
ReactEventHandler<HTMLInputElement>
onSubmit?
SubmitEventHandler<HTMLInputElement>
onSubmitCapture?
SubmitEventHandler<HTMLInputElement>
onSuspend?
ReactEventHandler<HTMLInputElement>
onSuspendCapture?
ReactEventHandler<HTMLInputElement>
onTimeUpdate?
ReactEventHandler<HTMLInputElement>
onTimeUpdateCapture?
ReactEventHandler<HTMLInputElement>
onToggle?
ToggleEventHandler<HTMLInputElement>
onTouchCancel?
TouchEventHandler<HTMLInputElement>
onTouchCancelCapture?
TouchEventHandler<HTMLInputElement>
onTouchEnd?
TouchEventHandler<HTMLInputElement>
onTouchEndCapture?
TouchEventHandler<HTMLInputElement>
onTouchMove?
TouchEventHandler<HTMLInputElement>
onTouchMoveCapture?
TouchEventHandler<HTMLInputElement>
onTouchStart?
TouchEventHandler<HTMLInputElement>
onTouchStartCapture?
TouchEventHandler<HTMLInputElement>
onTransitionCancel?
TransitionEventHandler<HTMLInputElement>
onTransitionCancelCapture?
TransitionEventHandler<HTMLInputElement>
onTransitionEnd?
TransitionEventHandler<HTMLInputElement>
onTransitionEndCapture?
TransitionEventHandler<HTMLInputElement>
onTransitionRun?
TransitionEventHandler<HTMLInputElement>
onTransitionRunCapture?
TransitionEventHandler<HTMLInputElement>
onTransitionStart?
TransitionEventHandler<HTMLInputElement>
onTransitionStartCapture?
TransitionEventHandler<HTMLInputElement>
onVolumeChange?
ReactEventHandler<HTMLInputElement>
onVolumeChangeCapture?
ReactEventHandler<HTMLInputElement>
onWaiting?
ReactEventHandler<HTMLInputElement>
onWaitingCapture?
ReactEventHandler<HTMLInputElement>
onWheel?
WheelEventHandler<HTMLInputElement>
onWheelCapture?
WheelEventHandler<HTMLInputElement>
openOnFocus?
boolean = false
Open the dropdown automatically when the input gains focus, even when no query is typed yet.
Default
falseoptions
ComboboxOption<T>[]
Available options
part?
string
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part
placeholder?
string
Placeholder rendered when the input is empty
popover?
"" | "auto" | "manual" | "hint"
popoverTarget?
string
popoverTargetAction?
"toggle" | "hide" | "show"
prefix?
string
property?
string
radioGroup?
string
readOnly?
boolean = false
Read-only — input value is fixed
ref?
Ref<HTMLInputElement>
rel?
string
required?
boolean = false
Mark the field as required
resource?
string
results?
number
rev?
string
role?
AriaRole
security?
string
size?
Size = 'md'
Component size
slot?
string
spellCheck?
Booleanish
style?
CSSProperties
Custom inline styles
suppressContentEditableWarning?
boolean
suppressHydrationWarning?
boolean
tabIndex?
number
testId?
string
Test identifier for automated testing
title?
string
translate?
"yes" | "no"
typeof?
string
unselectable?
"off" | "on"
value?
T | null
Controlled selected value
variant?
ComboboxVariant = 'default'
Visual variant
vocab?
string
Returns
Element
Example
<Combobox label="Framework" options={[ { value: 'react', label: 'React' }, { value: 'vue', label: 'Vue' }, ]} value={framework} onChange={setFramework}/>