UI

Multiselect

A labelled combobox and multi-select field with inline search, removable chips, grouped options, and rolling overflow counts.

import { Multiselect } from '@uthereal/ui/multiselect'

Multiselect playground

Design, Engineering
Loading interactive preview…

Overview

Multiselect lets users choose one or more values from a list of options inside a standard form field. In multiple mode, chosen options appear as pill chips on a single row and fold overflow into a rolling +N badge past maxVisible. In single mode, the field shows the chosen option label and keeps it visible as placeholder text while searching.

Set searchable={false} for short lists where a compact chip or label trigger fits better than a text input. Use Morph select when a standalone button should morph into a picker or multi-input card outside a form layout. Use Checkbox or Radio when all choices should stay visible on the page.

Usage

'use client'
import { Multiselect } from '@uthereal/ui/multiselect'

export function LabelPicker() {
  return (
    <Multiselect
      label="Labels"
      defaultValue={['design', 'engineering']}
      options={[
        { value: 'design', label: 'Design', keywords: ['ui', 'ux'] },
        { value: 'engineering', label: 'Engineering', keywords: ['code'] },
        { value: 'product', label: 'Product', keywords: ['roadmap'] },
        { value: 'research', label: 'Research', keywords: ['study'] },
      ]}
      onValueChange={(value) => console.log(value)}
    />
  )
}

Multiselect works uncontrolled with defaultValue or controlled with value and onValueChange. For server-side filtering, set filter="none", read typed text from onQueryChange, pass the fetched options, and toggle loading while requests run.

Examples

Selection modes and compact triggers

Combine selectionMode and searchable to switch between a searchable single-value autocomplete (selectionMode="single", searchable={true}) and a compact non-searchable multi-select trigger (selectionMode="multiple", searchable={false}).

Open, In review

Groups, selection caps, and overflow

Group related options with inline group labels. Set maxSelected to cap selections without silently dropping existing values; unselected options read as disabled once the cap is reached. Set maxVisible to control how many chips show before the rolling +N badge folds the rest away.

Alice Chen, Bruno Silva, Claire Patel
Select up to three reviewers; extra chips fold into +N.
SOC 2, GDPR
Locked by organization settings.

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
labelstringDefault: "Labels"Visible label and accessible name. Name the information asked for, in sentence case.
hideLabelbooleanDefault: falseHide the label visually when the context already names the field. It is still announced.
descriptionstring—Supporting text below the field, announced with it. Use it for format hints and constraints.
errorstring—Validation message from your application. Setting it marks the field invalid; the message is linked to the field and announced politely.
requiredbooleanDefault: falseMarks the field as required for assistive technology and shows an indicator. Your application validates the value.
readOnlybooleanDefault: falseThe value can be focused, selected, and copied, but not edited. It is still submitted with a form.
disabledbooleanDefault: falseUnavailable and removed from the tab order. A disabled field is not submitted with a form.
namestring—Native form field name, submitted with the value in a form.
selectionModemultiple | singleDefault: "multiple"Choose several values, shown as Arc's pill chips in one row of the field (maxVisible, then a "+N" count), or exactly one, shown as its label. Backspace in the empty input removes the last value; the clear button clears them all.
searchablebooleanDefault: trueType to filter choices inside the field, in both modes. Off shows a compact chip/label trigger button that opens the same list, as in Arc's multi-select.
optionsMultiselectOption[]Default: [{"value":"design","label":"Design","disabled":false},{"value":"engineering","label":"Engineering","disabled":false},{"value":"product","label":"Product","disabled":false}]The choices, in order: value (unique, reported when chosen), label and optional keywords (matched against the typed text), optional description, icon and inline group, and disabled. Up to 500.
defaultValuestring | string[]—Initially chosen value, or a list of values when several may be chosen. Later argument edits do not reset an existing instance; use value and onValueChange to control it.
maxSelectedinteger—Most values chosen at once in multiple mode. At the cap, further unselected options read as disabled, so a new choice never silently drops an old one.
maxVisibleintegerDefault: 2The chips shown before the rest fold into a "+N" count (2 by default, as in Arc).
placeholderstringDefault: "Search or select…"Prompt while nothing is chosen ("Search or select…" by default). While searching, the chosen label shows in its place, as in Arc. Never a substitute for the label.
emptyLabelstringDefault: "No matches found"Shown and announced when no option matches the typed text ("No matches found").
filtercontains | startsWith | noneDefault: "contains"contains matches the typed text anywhere in a label, startsWith at its start. none shows options as given: filter or fetch them yourself from onQueryChange.
inputBehaviorautohighlight | autocomplete | noneDefault: "none"none (default, as in Arc) leaves the highlight to the arrow keys; autohighlight highlights the first match so Enter chooses it; autocomplete also completes the input with it.
allowCustomValuebooleanDefault: falseKeep typed text that matches no option when the input loses focus. It is not added to the value; read it with onQueryChange.
openOnClickbooleanDefault: trueOpen the list when the field is clicked.
openOnFocusbooleanDefault: trueOpen the list as soon as the input takes focus, from Tab or a click, as in Arc.
clearablebooleanDefault: trueShow a 22px clear button while a value is chosen. A single selection reopens the list after clearing; a multiple one clears every value and closes it, as Arc's multi-select.
clearLabelstringDefault: "Clear selection"Accessible name of the clear button.
clearAllLabelstringDefault: "Clear selections"Accessible name of the clear button of a multiple selection ("Clear selections").
listLabelstringDefault: "{label} options"Accessible name of the list of options; {label} is the field label ("Owner options").
closeOnSelectboolean—Close the list after a choice. On by default for a single selection and off for several, as in Arc; set it to pin the other behavior.
loadingbooleanDefault: falseOptions are being fetched: the list shows and announces loadingLabel and is marked busy.
loadingLabelstringDefault: "Loading"Shown and announced while loading, e.g. "Searching".
variantoutline | soft | ghostDefault: "outline"Field surface: outline for forms, soft on busy surfaces, ghost for inline editing without a border.
sizesm | md | lgDefault: "md"Input height and text size (36, 44, or 50 pixels, matching a button or text field) and the option density of the list.
placementPlacementDefault: "bottom-start"Preferred side and alignment of the list; it flips or shifts to stay in the viewport.
loopFocusbooleanDefault: trueArrow keys wrap from the last option to the first and back (on by default, as in Arc).
recipestudio | softDefault: "studio"Visual treatment. Both recipes use the same interaction behavior.
themeMultiselectTheme—Color mode, accent, and tokens, including the field and popup list tokens shared with Select and the dropdown menu. See Theming.
motionnone | subtle | expressiveDefault: "subtle"Popup and chip animation preset. System reduced-motion preferences take precedence.
motionOptionsMultiselectMotionOptions—The popup transition (Arc's snappy spring by default) and its entrance and exit poses (6px at .97 in, 4px at .98 out); durations are milliseconds.
dirltr | rtl—Reading direction; it also mirrors start and end placements. Omit it to inherit the page direction.

React integration

PropPurpose
value, onValueChange(value)Control the chosen value (string in single mode, string[] in multiple mode).
query, onQueryChange(query)Control or observe the search text, e.g. to filter or fetch options when filter="none".
open, onOpenChange(open)Control popup visibility.
renderIcon(name, { size, slot })Replace decorative icons for search, value, option, chip, or clear slots.
portalContainerExplicit portal host inside a native modal dialog top layer.
ref, preset, tokens, className, styleForward ref to the combobox input; className, style, and tokens apply to root and portal.

Keyboard & accessibility

KeyAction
ArrowDown, ArrowUpOpen the closed list without highlighting a row; when open, move highlight through enabled options.
Home, EndJump highlight to the first or last enabled option while open.
EnterSelect or toggle the highlighted option; when searchable={false} and no row is highlighted, toggle the list.
SpaceInsert a space while searchable; toggle the list when searchable={false} and no row is highlighted.
BackspaceWhen the input is empty in multiple mode, remove the last selected chip.
EscapeClose the list and restore the kept single-selection label unless allowCustomValue is on.
Tab, Shift+TabClose the list and move focus to the next or previous control.

The control exposes role="combobox", aria-expanded, aria-controls, aria-activedescendant, and aria-multiselectable on the portalled role="listbox". In multiple mode, a visually hidden summary joins aria-describedby so screen readers announce chosen labels without altering the field's accessible name. A pre-mounted polite role="status" region announces loadingLabel and emptyLabel. Setting error attaches the alert text through aria-describedby and renders it as role="alert". Layout and spacing use logical CSS properties for dir="rtl", and @media (forced-colors: active) preserves chip outlines, panel borders, and highlighted option contrast.

Motion and theming

Opening springs the popup 6px from the field at scale 0.97 on Arc's snappy spring while opacity fades in over 160ms; closing exits 4px at scale 0.98 over 120ms. List height follows filtering on a zero-bounce smooth spring, rows glide up to six positions while filtering, and a per-instance gliding highlight follows the active option. In multiple mode, chip slots spring open, chips scale in through a soft blur, the +N count rolls vertically in the direction of change, and checkmarks draw their stroke on selection.

Setting motion="none" makes popup presence, list height, highlight movement, chips, checkmarks, label swaps, and button states immediate (0ms) with no press scale. Under prefers-reduced-motion: reduce, travel, scale, blur, and path drawing stop while keeping 120ms opacity crossfades.

theme accepts mode, accent, and tokens from the core, control, and popupList groups plus borderStrong and borderSubtle. Resolved --ui-* tokens emit inline on both the field root and the portalled popup.

Composition

Multiselect is a leaf component. Chosen state binds to fields.<id>.value (string[] in multiple mode, string in single mode). When an edit removes stored option values, reconciliation keeps remaining valid values or falls back to defaultValue.

{
  "type": "Multiselect",
  "props": {
    "label": "Reviewers",
    "selectionMode": "multiple",
    "maxSelected": 2,
    "maxVisible": 2,
    "defaultValue": ["alice"],
    "options": [
      { "value": "alice", "label": "Alice Chen", "group": "Core" },
      { "value": "bruno", "label": "Bruno Silva", "group": "Core" },
      { "value": "claire", "label": "Claire Patel", "group": "Security" }
    ]
  }
}

On this page