Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Combobox

ProNew

A searchable select for long lists, with descriptions, icons, a clear button and prefix matches ranked first.

Installation

pnpm dlx shadcn@latest add @viewport/combobox

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
options*ComboboxOption[]—
valuestring | null—
defaultValuestring | nullnull
onValueChange(value: string | null) => void—
placeholderstring

Shown in the closed control while nothing is selected.

"Select…"
searchPlaceholderstring

Placeholder and accessible name of the search field.

"Search…"
emptyTextstring

Shown when the search matches nothing.

"No results"
clearableboolean

Show a button that clears the selection.

false

Accessibility

  • The combobox pattern: focus stays in the search field while arrow keys move the highlight.
  • The number of results is announced as you type.
  • Disabled options are skipped by the keyboard.
  • No scale animation under reduced motion.