Combobox

molecules

Searchable select with type-ahead. Combines input with dropdown list.

ARIA Role: combobox

Demo

Demo for Combobox (molecules)

Searchable select with type-ahead. Combines input with dropdown list.

Props

PropTypeRequiredDefaultDescription
optionsOption[]YesSelectable options
valuestringNoSelected value
onChange(value: string) => voidYesValue change handler
placeholderstringNoInput placeholder
disabledbooleanNofalseDisabled state
allowCustombooleanNofalseAllow custom values

TypeScript Interface

interface ComboboxProps {
  options: Option[];
  value?: string;
  onChange: (value: string) => void;
  placeholder?: string;
  disabled?: boolean;
  allowCustom?: boolean;
}

Assertions (NASA Rule 5)

  • [aria]role='combobox' on input, aria-expanded, aria-controls(WAI-ARIA APG)
  • [aria]Listbox must have role='listbox' with children role='option'(WAI-ARIA APG)
  • [keyboard]Arrow keys navigate, Enter selects, Escape closes(WCAG 2.1.1)
  • [aria]aria-activedescendant tracks focus within listbox(WCAG 4.1.2)

Usage

Import

import { Combobox } from '@epasslive/design-system'

Basic

<Combobox />

With Variants

<Combobox variant="primary" size="md" />