Skip to content
Data Input

Typeahead

Search-as-you-type single-select built on Combobox.

Typeahead

Single-select combobox that filters options as the user types. Built on the shared Combobox primitive with label, description, error, clear button, and listbox wiring included.

Examples

Default

Demo.tsxtsx
import { Typeahead } from '@var-ui/react';

<Typeahead
  label="Fruit"
  options={[
    { id: 'apple', label: 'Apple' },
    { id: 'plum', label: 'Plum' },
    { id: 'orange', label: 'Orange' },
  ]}
/>

Description and validation

Pass description for helper text and errorMessage to show an error state.

Start typing to filter the list.
Demo.tsxtsx
import { Typeahead } from '@var-ui/react';

<Typeahead
  label="Fruit"
  description="Start typing to filter the list."
  errorMessage="Choose a fruit to continue."
  options={[
    { id: 'apple', label: 'Apple' },
    { id: 'plum', label: 'Plum' },
    { id: 'orange', label: 'Orange' },
  ]}
/>

Props

Accessibility

Built on React Aria Components where applicable.