Dashral Pro is on the wayGet 30% off at launch

Dashral

Multi Select

Pick several options from a searchable list; the picks show as removable chips.

$ pnpm dlx shadcn@latest add https://dashral.com/r/multi-select.json
  • Email
  • Push

Installation

$ pnpm dlx shadcn@latest add https://dashral.com/r/multi-select.json

Adds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:

components.json
{
  "registries": {
    "@dashral": "https://dashral.com/r/{name}.json"
  }
}

Then add components by name:

$ pnpm dlx shadcn@latest add @dashral/multi-select

Usage

example.tsx
import { MultiSelect } from "@/components/dashral/multi-select"

<MultiSelect
  label="Labels"
  defaultValue={["bug"]}
  options={[
    { value: "bug", label: "Bug" },
    { value: "feature", label: "Feature" },
    { value: "docs", label: "Docs" },
  ]}
/>

Examples

Limited picks

maxSelected caps the picks; maxShown collapses the rest into +N.

  • React
  • TypeScript

Up to 3. After two, the rest show as +1.

Campaign audience

Segments with their sizes, and an estimate of the people reached (overlap removed).

Black Friday preview

Email campaign · draft

  • VIP (5+ orders) · 640
  • Abandoned cart · 470

Reaches about 1,021 people

overlap removed

API reference

MultiSelect

PropTypeDefault
options{ value: string; label: string; disabled?: boolean }[]

Required.

—
value / defaultValuestring[]

Picked values, controlled or initial.

[]
onValueChange(value: string[]) => void

Called with the new value.

—
maxShownnumber

Chips shown before the rest collapse into “+N”.

3
maxSelectednumber

At most this many picks.

—
placeholder / searchPlaceholder / emptyTextstring—
id / disabled / aria-label / className

className styles the box.

—
labelReactNode

Shown above, linked to the control.

—
descriptionReactNode

A hint under the control.

—
errorboolean | ReactNode

true shows the error style; a message also shows under the control.

—
labelActionReactNode

At the end of the label's row, e.g. a “Forgot password?” link or the current value.

—
withAsteriskboolean

Marks the label with an asterisk, e.g. alongside required.

false
classNames{ root, label, description, error, box, content, item }

Classes for each part.

—

Keyboard

KeysAction
EnterorSpaceor↓Open the list
TypeFilter the list
↓or↑Move through the options
EnterPick or unpick the highlighted option
BackspaceRemove the last pick (on the closed field)
TabReach each chip's remove button
EscapeClose

Accessibility

  • Picked options say “selected”; each chip's remove button names the option; the trigger says how many are picked.

Motion

  • Opens with a fade, a scale from 95%, a 2px blur clearing and a 4px slide from its trigger's side, on the spring (--duration-standard); closes faster (--duration-fast, --ease-exit). No blur with reduced motion.