bearnie

Combobox

A searchable dropdown for selecting one option.

Installation

npx bearnie add combobox
npx bearnie add combobox

Usage

import { Combobox } from "@/components/bearnie/combobox"
<Combobox
  options={[
    { value: "lexington", label: "lexingtonthemes.com" },
    { value: "colors-fonts", label: "colorsandfonts.com" },
  ]}
  placeholder="Select a domain"
/>

Examples

Clearable

Grouped options

Rich items

Input-group addon

Anatomy

  • Combobox - Root searchable select component.
  • ComboboxTrigger - Trigger button for opening the options list.
  • ComboboxContent - Popover content container.
  • ComboboxItem - Selectable option row.

Props

Combobox

PropTypeDefaultDescription
optionsComboboxOption[] | ComboboxGroup[][]Flat options or grouped options
valuestring""Initial selected value
namestring-Hidden input name for form submissions
placeholderstring”Select an option”Trigger placeholder text
searchPlaceholderstring”Search…”Search input placeholder
emptyMessagestring”No results found.”Empty state label
disabledbooleanfalseDisables trigger and selection
clearablebooleanfalseShows clear action when a value is selected
inputGroupControlbooleanfalseAdapts trigger for InputGroup composition
classstring-Additional CSS classes

Events

  • combobox-change - Emitted on selection with { value, label } detail.