Skip to content

Data Input

Typeahead

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

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

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={[
    { value: 'apple', label: 'Apple' },
    { value: 'plum', label: 'Plum' },
    { value: 'orange', label: 'Orange' },
  ]}
/>

Description and validation

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

Start typing to filter the list.

Choose a fruit to continue.
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={[
    { value: 'apple', label: 'Apple' },
    { value: 'plum', label: 'Plum' },
    { value: 'orange', label: 'Orange' },
  ]}
/>

Props

Accessibility

Built on React Aria Components where applicable.