Combobox

A searchable select built from Popover and Command. Single or multiple, groups, descriptions, icons and animated badges.

Inputs

Playground

Tweak the props, the preview and the code follow.

Props
const options = [
  { value: "next", label: "Next.js" },
  { value: "astro", label: "Astro" },
  // …
]

<Combobox options={options} placeholder="Select a framework" />

Installation

npx @plumsydev/plum-ui add combobox

Also pulls in popover, command automatically.

Usage

import { Combobox } from "@/components/ui/combobox"
<Combobox
  options={[
    { value: "next", label: "Next.js" },
    { value: "astro", label: "Astro" },
  ]}
  placeholder="Select a framework"
/>

Examples

Multiple

Selected items become badges you can remove inline.

2 reviewers will be notified.

Groups

API Reference

Combobox

PropTypeDefault
options*

The choices.

{ value, label, description?, icon?, group?, disabled?, keywords? }[]—
multiple

Switch `value` to `string[]`.

booleanfalse
value / defaultValue

Selected value(s).

string | string[]—
onValueChange

Called on selection.

(value) => void—
placeholder

Trigger text when empty.

string"Select…"
searchPlaceholder

Search field placeholder.

string"Search…"
emptyText

Shown when nothing matches.

ReactNode"No results."
maxBadges

With `multiple`, badges shown before +n.

number3