Tac UIv1.1.2

Combobox

A searchable select input that allows users to filter and choose from a list of options.

Import

tsx
import { Combobox } from '@tac-ui/native';

Default

A searchable dropdown that filters options as the user types.

tsx
const [value, setValue] = useState('');

<Combobox
  options={frameworkOptions}
  value={value}
  onChange={setValue}
  placeholder="Select a framework..."
  emptyText="No framework found."
/>

Disabled Options

Individual options can be marked disabled — they appear at reduced opacity and cannot be selected.

tsx
<Combobox
  options={[
    { label: 'React', value: 'react' },
    { label: 'Vue', value: 'vue', disabled: true },
    { label: 'Angular', value: 'angular', disabled: true },
    { label: 'Svelte', value: 'svelte' },
  ]}
  placeholder="Select a framework..."
/>

Controlled

Manage the selected value externally with value and onChange — the display reflects the matching option label.

tsx
const [value, setValue] = useState('react');

<Combobox
  options={frameworkOptions}
  value={value}
  onChange={setValue}
  placeholder="Select a framework..."
/>

API Reference

PropTypeDefaultDescription
optionsComboboxOption[]-Array of { label, value, disabled? } option objects to display and filter.
valuestring-Controlled selected value. The matching option label is displayed in the input.
onChange(value: string) => void-Called when the user selects an option from the dropdown.
placeholderstring"Search…"Placeholder text shown in the input when no value is selected.
emptyTextstring"No results found"Text displayed in the dropdown when no options match the search query.
styleViewStyle-Additional styles applied to the outer container.