MultiSelect
Select preset with multiple=true, search and clear: chips in the trigger, checkboxes in the list.
Code
import * as React from 'react';
import { MultiSelect } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 380,
minHeight: 320,
}}
>
<MultiSelect
label="Labels"
defaultOpen
defaultValue={['bug', 'design']}
options={[
{
value: 'bug',
label: 'Bug',
},
{
value: 'design',
label: 'Design',
},
{
value: 'docs',
label: 'Docs',
},
{
value: 'perf',
label: 'Performance',
},
{
value: 'sec',
label: 'Security',
},
]}
/>
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { MultiSelect } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/multi-select.jsonGuidelines
- Shows up to
maxChipschips, then +N.
Props
| Prop | Type | Required |
|---|---|---|
options | Array<string | SelectOption> | Yes |
value | string[] | No |
defaultValue | string[] | No |
onChange | (value: string[]) => void | No |
label | string | No |
placeholder | string | No |
maxChips | number | No |
required | boolean | No |
defaultOpen | boolean | No |