Combobox

The Combobox component provides an enhanced input field with autocomplete functionality, allowing users to either select from predefined options or enter custom values.

Usage

First of all, you need to import the Combobox component from the kitchn package.

import { Combobox } from "kitchn"

Default

Disabled

Search

Only Allow Selected

Loading State

Waiting in Search

Props

Combobox Props

NameTypeDefaultRequiredDescription
optionsArray<{ label: string; value: string }>[]NoArray of options to display in the dropdown
placeholderstring""NoPlaceholder text for the input field
initialValuestringundefinedNoInitial value for the input field
disabledbooleanfalseNoIf true, the combobox becomes non-interactive
disableFreeSolobooleanfalseNoIf true, only allows selection from provided options
searchingbooleanfalseNoIndicates if the component is in a loading state
clearablebooleanfalseNoIf true, shows a clear button when there is input
onSearch(value: string) => voidundefinedNoCallback function triggered on input change
onChange(value: string) => voidundefinedNoCallback function triggered when value changes

ComboboxSearching Props

NameTypeDefaultRequiredDescription
childrenReact.ReactNodeundefinedNoCustom content to display during loading state

ComboboxEmpty Props

NameTypeDefaultRequiredDescription
childrenReact.ReactNodeundefinedNoCustom content to display when no options match