Combobox

Filterable text field with an option list, optional async loading, and custom values.

Also known as: autocomplete, typeahead, filter select

Installation

Install with the CLI, or copy the component source into your project.

Add combobox (npm)

npx --yes -p github:itsvigneshv/default-file-ui#main df-ui add combobox

Properties

Filterable text field backed by Option List. Supports static options, async loading, clear, and optional custom values.

Combobox

PropTypeDefaultNotes
valuestring-Controlled committed option value. The input shows the matching label; typing uses a separate query string.
defaultValuestring-Uncontrolled initial option value.
onValueChange(value: string) => void-Called with the option value when a selection is committed, or with custom text when allowCustomValue is set.
optionsreadonly ComboboxOption[]-Static options to filter.
loadOptions(query: string) => Promise<ComboboxOption[]>-Async option loader for the current query.
allowCustomValueboolean-Allow committing text that is not in the option list.
clearablebooleantrueShow a clear control when the field has text.
placeholderstring-Input placeholder.
disabledboolean-Disable the field.
invalidboolean-Mark the field invalid for styling and aria-invalid.
openboolean-Controlled list open state.
defaultOpenboolean-Uncontrolled initial open state.
onOpenChange(open: boolean) => void-Called when the list open state changes.
debounceMsnumber-Debounce for async loadOptions.
idstring-Id on the text input.
emptyContentReactNode-Content when the filtered list is empty.
itemChromeListItemChromeProps-Default List Item chrome for every option row.
aria-labelstring-Accessible name when no aria-labelledby is set.
aria-labelledbystring-Id of an external label. When set, aria-label is omitted so the external name wins.
classNamestring-Additional styles on the root.