Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Combobox

Visually the same control as Select, plus an input that filters the collection as you type. @zag-js/combobox handles filtering, keyboard highlight, and open/close behaviour. The trigger has no data-state of its own, so it is styled through the control using Tailwind’s group modifier.

React Comboboxlive
import { Combobox } from "@/components/ui/combobox";
const timezones = [
{ label: "Asia/Jakarta (WIB)", value: "wib" },
{ label: "Asia/Singapore (SGT)", value: "sgt" },
];
<Combobox label="Timezone" items={timezones} placeholder="Search timezone" />
Terminal window
npx @glaceon/cli add combobox --framework react # or svelte, solid
Element Data Attribute Value Description
control data-state "open" | "closed" Popover visibility. Drives the border and the indicator rotation.
control data-focus "" The input holds focus.
control data-disabled "" Present when disabled.
input data-state "open" | "closed" Popover visibility.
content data-state "open" | "closed" Popover visibility.
content data-empty "" The filter matched nothing.
item data-state "checked" | "unchecked" The selected item.
item data-highlighted "" The keyboard-highlighted item.
Prop Type Default Description
items { label: string, value: string }[] required Builds the Zag ListCollection.
placeholder string "Search" Input placeholder text.
label string undefined Renders a <label> wired to the input.
name string undefined Name for form submission.
disabled boolean false Disables the whole control.
class / className string undefined Extra classes, appended last.
Key Description
ArrowDown / ArrowUp Moves the highlight; opens the list when closed.
Enter Selects the highlighted item.
Esc Clears the input and closes the list.
Any character Filters the collection.