Combobox

Autocomplete input and command palette with a list of suggestions. Built using a composition of Popover and Command components.

Basic Combobox

A simple combobox for selecting a framework.

With Disabled Options

Some options can be disabled.

Java is disabled

With Custom Labels

Labels can include emojis or any custom content.

Multi-Select Combobox

Select multiple options from the list.

Multi-Select with Max Display

Limit the number of displayed selections.

Shows "X selected" when more than 2 items are selected

Installation

The Combobox is built using a composition of the Popover and Command components.

npx brutx@latest add combobox popover command

Props

Combobox

PropTypeDefaultDescription
optionsComboboxOption[]requiredArray of options to display
valuestring-Selected value
onValueChange(value: string) => void-Callback when value changes
placeholderstring"Select option..."Placeholder text
searchPlaceholderstring"Search..."Search input placeholder
emptyTextstring"No results found."Text when no results
disabledbooleanfalseDisable the combobox

ComboboxMulti

Same props as Combobox, plus:

PropTypeDefaultDescription
valuestring[][]Array of selected values
onValueChange(value: string[]) => void-Callback when values change
maxDisplaynumber3Max items to show before "X selected"

ComboboxOption

PropertyTypeDescription
valuestringUnique value for the option
labelstringDisplay label
disabledbooleanWhether the option is disabled