Skip to main content

Multi-select

A combobox for selecting multiple values, with a searchable list and removable badge chips. Built on Popover + Command + Badge. Exports the MultiSelectOption type.

import { MultiSelect, type MultiSelectOption } from '@rtorcato/shadcn-ui/components/ui-extended/multi-select'

Usage

const options: MultiSelectOption[] = [
{ label: 'React', value: 'react' },
{ label: 'Vue', value: 'vue' },
{ label: 'Svelte', value: 'svelte' },
]

const [value, setValue] = useState<string[]>([])

<MultiSelect options={options} value={value} onValueChange={setValue} />

Props

PropTypeDefaultDescription
optionsMultiSelectOption[]{ label, value } choices.
valuestring[]Selected values (controlled).
onValueChange(value: string[]) => voidSelection change handler.
placeholderstring'Select…'Trigger placeholder.
searchPlaceholderstringSearch input placeholder.
emptyMessagestringShown when the search has no matches.
disabledbooleanfalseDisable the control.
classNamestringWrapper class.