apps/design-system/content/docs/fragments/multi-select.mdx
import {
MultiSelector,
MultiSelectorContent,
MultiSelectorItem,
MultiSelectorTrigger,
} from 'ui-patterns/multi-select'
<MultiSelector
open={open}
onOpenChange={setOpen}
selected={selected}
onSelectedChange={onSelectedChange}
>
<MultiSelectorTrigger className="w-72" label="Fruits" />
<MultiSelectorContent sameWidthAsTrigger>
<MultiSelectorItem value="Apple">Apple</MultiSelectorItem>
<MultiSelectorItem value="Banana">Banana</MultiSelectorItem>
<MultiSelectorItem value="Grape">Grape</MultiSelectorItem>
<MultiSelectorItem value="Strawberry">Strawberry</MultiSelectorItem>
</MultiSelectorContent>
</MultiSelector>
Use MultiSelectorInputto add a search input.
creatable: boolean
creatable prop on the MultiSelectorList component can be used to add a new option if no items match
badgeLimit: number | "wrap".
badgeLimit prop on the MultiSelectorTrigger component can be used to limit the number of badges displayed.
badgeLimit prop can also be "wrap" to wrap the badges to the next line.
Add the deletableBadge prop on the MultiSelectorTrigger component to enable badge removal directly from the badge.
Use mode="inline-combobox" on the MultiSelectorTrigger component to add an inline search input.