Combobox Example
How to use this loader
Props
Name | Type | Default | Description |
---|---|---|---|
dataTab | T[] | [] | This is the data to display in the combobox. |
order | string | - | The title when the combobox is closed. |
placeholder | string | - | The placeholder when the combobox is closed. |
emptyCommand | string | - | 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. |
value | string | - | The selected value. |
keyValue | keyof T | 'value' | The key in dataTab that corresponds to the value field. |
keyLabel | keyof 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}/>