Xzero UI
Pro library

Multi-select

Select several values while keeping the field readable.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/multi-select
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/multi-select

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { MultiSelect } from "@/components/xzero/multi-select/multi-select";

export function LabelPicker() {
  const [labels, setLabels] = useState<string[]>(["bug"]);
  return (
    <MultiSelect
      label="Labels"
      value={labels}
      onValueChange={setLabels}
      options={[
        { value: "bug", label: "Bug" },
        { value: "feature", label: "Feature" },
        { value: "docs", label: "Docs" },
      ]}
    />
  );
}

API reference

MultiSelect

A dropdown that picks several values, showing them as chips with a rolling +N overflow count.

PropTypeDefaultDescription
label (required)string–Visible label, also names the listbox.
options (required)MultiSelectOption[]–{ value, label, disabled? } in list order.
valuestring[]–Controlled selected values.
defaultValuestring[][]Initial values when uncontrolled.
onValueChange(value: string[]) => void–Called with the full new selection.
placeholderstring"Select options"Shown when nothing is selected.
descriptionstring–Helper copy under the field.
maxVisiblenumber2Chips shown in the trigger before the rest collapse into +N.
disabledbooleanfalseDisables the trigger and hides the clear button.
classNamestring–Added to the root.

Keyboard interactions

KeysAction
Enter / SpaceOpens or closes the list; Enter toggles the active option while open.
ArrowDown / ArrowUpOpens the list and moves through enabled options, wrapping.
EscapeCloses the list.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in selects

Guidance for AI tools

Multi-select: Select several values while keeping the field readable. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components