Combobox Example

How to use this loader

Props

NameTypeDefaultDescription
dataTabT[][]This is the data to display in the combobox.
orderstring-The title when the combobox is closed.
placeholderstring-The placeholder when the combobox is closed.
emptyCommandstring-The displayed string when the input value does not fit the possibilities.
onValueChange(value:T) => void-The triggered function when a value is chosen.
onInputChange(value: string) => void-The triggered function when the input changes.
valuestring-The selected value.
keyValuekeyof T'value'The key in dataTab that corresponds to the value field.
keyLabelkeyof T'label'The key in dataTab that corresponds to the label field.

Playground

Import from filigran-ui :

import { Combobox } from "filigran-ui"
<Combobox dataTab={[
    {value: 'abcd', label: 'Abcd'},
    {
      value: 'acde',
      label: 'Acde'
    },
    {value: 'acef', label: 'Acef'}
    ]}
    order={'Choose a value'}
    placeholder={'Choose a value'}
    emptyCommand={'Not found'}
    onValueChange={(value) => setSelectedValue(value)}
    onInputChange={(value) => setInputValue(value)}
    value={selectedValue}/>