Combobox
interlace-ui/comboboxFreeComponent
A text input that filters a list. Built on `@base-ui/react/combobox`: Base UI owns the filtering (`Intl.Collator`-backed `useFilter`), the combobox/listbox ARIA pairing, VIRTUAL focus (the input keeps DOM focus and `aria-activedescendant` moves), single +…
Install it
npx shadcn@latest add https://ds.interlace.tools/r/combobox.jsonSource
1'use client';23import * as React from 'react';45// @interlace/combobox v1.0.0 — Interlace design system.6// Docs, props and live preview: https://ds.interlace.tools/c/combobox7// What changed since: https://ds.interlace.tools/c/combobox#history8// Generated banner — keep it, the upgrade diff reads this version.910/**11 * @interlace/ui — Combobox12 *13 * A text input that filters a list. Built on `@base-ui/react/combobox`: Base UI14 * owns the filtering (`Intl.Collator`-backed `useFilter`), the15 * combobox/listbox ARIA pairing, VIRTUAL focus (the input keeps DOM focus and16 * `aria-activedescendant` moves), single + multiple selection, chips, and the17 * whole keyboard model. We own the surface — size, tokens, focus ring, target18 * sizes.19 * Mirrors: https://ui.shadcn.com/docs/components/combobox20 *21 * ## Combobox vs Select vs DropdownMenu22 *23 * `Select` is the right primitive when the user picks from a list they can24 * read at a glance and can NOT type into. `Combobox` is for the list that is25 * too long to scan — the user types to narrow it. `DropdownMenu` is for26 * ACTIONS, not values. Reaching for a Combobox under ~7 options is a27 * downgrade: it trades a one-keystroke listbox for a text field.28 *29 * ## Anatomy30 *31 * Combobox (Root) (no DOM — state + filtering)32 * ├─ ComboboxChips (multiple only)33 * │ └─ ComboboxChip → ComboboxChipRemove34 * ├─ ComboboxControl (ours — relative row, no Base UI part)35 * │ ├─ ComboboxInput (input — data-min-viewport=320)36 * │ ├─ ComboboxClear (button, keepMounted=false)37 * │ └─ ComboboxTrigger → ComboboxIcon (optional open button)38 * └─ ComboboxContent (portal → positioner → popup)39 * ├─ ComboboxEmpty (renders only when 0 results)40 * ├─ ComboboxStatus (polite live region — async lists)41 * └─ ComboboxList42 * ├─ ComboboxGroup → ComboboxGroupLabel43 * ├─ ComboboxItem (repeats)44 * └─ ComboboxSeparator45 *46 * ## Filtering — the one trap in this API47 *48 * Base UI filters through `ComboboxCollection`, which `ComboboxList` wraps49 * implicitly when its child is a FUNCTION. Both of these render; only the50 * first one filters:51 *52// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article Cardarticle-card | interlace-ui | Components | Free | no deps |
