Weftv0.4.0
GitHubFigma
Blade AI
Inputs · Comboboxstable

Combobox

Searches a long list and picks one option. A trigger opens a popover with a search field and results; three sizes, square, flat and token-driven.

Preview

#preview

Switch size, validation and state. The React and CSS tabs update with the preview.

Framework
Search or pick from the list.
size medium · 6 options · emptyText
framework-combobox.tsx
import { Combobox } from "@blade-ai/weft/components/combobox";

export function FrameworkField({ value, onChange }: Props) {
  return (
    <Combobox
      label="Framework"
      placeholder="Select framework…"
      emptyText="No framework found."
      options={frameworks}
      value={value}
      onValueChange={onChange}
      helpText="Search or pick from the list."
    />
  );
}

All states

#all-states

Trigger and popover states from the Combobox matrix, shown at size medium.

Combobox · 10 states · size medium · read-only tokens, loading-open and success border: UNDEFINED
Framework
Search or pick from the list.
Default · empty
Framework
Search or pick from the list.
Filled
Framework
Search or pick from the list.
Hover
Framework
Search or pick from the list.
Focus-visible
Framework
Next.js
SvelteKit
Nuxt
Remix
Astro
Gatsby
6 results
Search or pick from the list.
Open
Framework
Search or pick from the list.
Disabled
Framework
Set by your admin.
Read-only
Framework
Loading options…
Loading
Framework
Invalid
Framework
Saved
Success

Props

#props

Booleans are is-prefixed. label and options are required. Multi-select is out of scope.

Prop
Type
Default
Description
label *
string
—
Accessible name of the trigger and of the search input.
labelPosition
"top" | "left"
"top"
left = 120px label column.
placeholder
string
"Select…"
Trigger text while the value is empty.
searchPlaceholder
string
"Search…"
Placeholder of the search input inside the popover.
options *
{ value, label, isDisabled? }[]
—
Rendered as option rows. Grouping key: UNDEFINED · needs decision.
value · defaultValue · onValueChange
string · (value) => void
—
Single value. Multi-select is not in the spec.
inputValue · onInputChange
string · (query) => void
""
Controlled query (needed for async). UNDEFINED · needs decision.
filter
(value, search) => number
"contains"
Return 0 to hide an option; higher ranks first. Default rule for Blade AI (contains vs starts-with): UNDEFINED · needs decision. Fallback: case-insensitive contains, starts-with ranked first.
emptyText
string
"No results found."
Copy for an empty list; pattern "No <noun> found.".
size
"small" | "medium" | "large"
"medium"
Trigger only; the search input and options stay medium / 32px on desktop.
validationState
"none" | "success" | "error"
"none"
error → aria-invalid + errorText. One message at a time.
helpText · successText · errorText
string
—
One message at a time; error replaces help.
isRequired · isDisabled
boolean
false
Required sets aria-required; disabled is native.
isReadOnly · isLoading
boolean
false
Not in Blade: UNDEFINED · needs decision. Read-only is focusable and cannot open; loading shows a spinner and cannot open (fallback).
isClearable · allowsCustomValue
boolean
—
Not built: UNDEFINED · needs decision (no clear button on the trigger, no free-text value).
isOpen · defaultOpen · onOpenChange
boolean · (open) => void
false
Controlled popover state.
name
string
—
Hidden input carrying the value for form submit.

Usage

#usage

When to reach for a combobox, and when not to.

Do
Use Combobox for long lists (15+) or when users know what to type; Select for 5–15; Radio group for 3–4.
Always set emptyText ("No framework found.") and keep the selected label visible in the trigger.
Bind only Theme and Global token names (no component tokens).
Announce the result count politely and keep focus in the search input while the highlight moves.
Don't
Use Combobox for 3–4 options, or let the typed query stand in for a value.
Rely on the match highlight alone to show results, or hide disabled matches without a reason.
Hard-code colours or radii, add component copies of Theme tokens, or add multi-select / create-option without a decision.

Accessibility

#accessibility

Button trigger, searchable combobox input and a listbox of options.

Keyboard
Key
Action
ArrowDown (closed)
Opens and highlights the selected option (or the first). ArrowUp when closed: UNDEFINED · needs decision.
ArrowDown / ArrowUp (open)
Moves the highlight one enabled result; focus stays in the input. Wrap: UNDEFINED · needs decision (fallback: stop at the ends).
Home / End (open)
Caret to start / end of the query (native). Highlight first / last result: UNDEFINED · needs decision.
Printable characters
Closed: no typeahead (opening on type: UNDEFINED · needs decision). Open: edit the query, filter, highlight the first match, announce the count.
Enter
Closed: opens (Space too). Open: selects the highlighted option, closes, focus to the trigger. No results: nothing.
Escape
Closes, value unchanged, query discarded, focus to the trigger. Two-step (clear query first): UNDEFINED · needs decision.
Tab / Shift+Tab
Closed: next / previous field. Open: closes without selecting; query discarded; focus moves on.
Backspace
Deletes query characters; on an empty query does nothing. Clearing the value: UNDEFINED · needs decision.
ARIA
Element
Role / attribute
When
Trigger
<button> · aria-haspopup="listbox" · aria-expanded · aria-controls → listbox id · aria-labelledby → label
Always. Which element carries role="combobox": UNDEFINED · needs decision (WAI-ARIA puts it on the input).
Search input
role="combobox" · aria-expanded="true" · aria-controls → listbox id · aria-autocomplete="list" · aria-activedescendant → highlighted option id · aria-labelledby → label
Popover open
Result list
role="listbox" · id · aria-labelledby → label · aria-busy while loading
Popover open
Option
role="option" · id · aria-selected · aria-disabled · data-selected (highlight)
Each result. Check icon aria-hidden; match spans are presentational.
Result count live region
visually hidden · role="status" · aria-live="polite" · aria-atomic="true"
After filtering. Exact copy: UNDEFINED · needs decision.
Empty text
plain text inside the popover (not an option)
Query matches nothing
Trigger (field)
aria-describedby → help / error · aria-invalid · aria-required · aria-disabled
Matching state

Agent Spec

#agent-spec

Machine-readable spec, tables (a)–(g). Same source as /specs/combobox.json and llms.txt.

/specs/combobox.json·component: "Combobox"·package: "@blade-ai/weft"·updated 2026-11-24
PropertyValueToken
Trigger height32 · 36 · 48size.32 · size.36 · size.48
Padding-x · gap8 · 6 (small) / 12 · 8spacing.3 · spacing.15 (small) / spacing.4 · spacing.3
Font13 · 13 · 14fonts.size.1200 · fonts.size.1200 · fonts.size.100
Icon14 · 16 · 16size.14 · size.16 · size.16
Menu · optionoption 32 · menu max 240 · padding 4size.32 · size.240 · spacing.2
Mobile drawer option48 shownUNDEFINED · needs decision