pro-ui

ComboBox

Searchable dropdown with filtering. Built on React Aria.

Import

import { ComboBox } from '@dangbt/pro-ui'

Basic usage

<ComboBox
  label="Framework"
  options={[
    { value: 'react', label: 'React' },
    { value: 'vue', label: 'Vue' },
    { value: 'svelte', label: 'Svelte' },
    { value: 'solid', label: 'SolidJS' },
  ]}
  placeholder="Search frameworks..."
/>

Controlled

const [value, setValue] = useState('')
 
<ComboBox
  label="Country"
  options={countries}
  value={value}
  onChange={setValue}
/>

Props

PropTypeDefaultDescription
labelstringLabel
options{ value: string; label: string }[]Options list
valuestringControlled value
onChange(value: string) => voidCalled on selection
placeholderstringPlaceholder text
isDisabledbooleanDisable

On this page