Skip to content
Protocore Design Systemv1.6.9

/// Inputs

MultiSelect

Combobox that holds many values as dismissible Tags, with a checkable, type-to-filter listbox.

import { MultiSelect } from "@protocore/pds";
View as Markdown

Basics

Pass options with value / label and an optional hint. Selected values render as Tags inside the sunken field; picking an option toggles it, and typing filters the list.

  • ledger:read
  • settlement:run

2 scope(s) granted

Max & clearable

Cap the selection with max — unselected options disable once the limit is reached. Add clearable for a one-click reset. Drive value from state and read onValueChange.

  • eu-central-1

1/3 regions selected

Sizes

size matches the control scale used by Input and Select: sm (32) · md (36, default) · lg (40) — it sets the minimum row height as Tags wrap.

  • prod
  • prod
  • eu-only
  • prod

When to use it

Reach for MultiSelect when a user picks several values from a known set — tags on a resource, scopes on a token, regions for a deploy. It differs from TagsInput, which lets users type *free-form* values that aren't in a list. Use a Combobox when only one value may be selected, and a Select for a short single-choice list. The listbox follows the ARIA multiselect combobox pattern: focus stays in the input while aria-activedescendant tracks the highlighted option and each option carries aria-selected.

Usage

Do

  • Give the input an accessible name via `aria-label` or a wrapping `Field`.
  • Use `max` when the field has a hard cap — options gate automatically.
  • Use it over a long list of checkboxes when the option set is long.
  • Make it `clearable` when 'select none' is a valid state.

Don't

  • Don't use it for free-form entry — use TagsInput.
  • Don't use it for a single choice — use Combobox or Select.
  • Don't pack long descriptions into `label`; each row is one line.
  • Don't leave it unlabelled; it announces as a nameless combobox.

Accessibility

KeysAction
TypeFilter the list; opens the popup and highlights the first match.
Arrow Down / UpMove the active option (opens the popup if closed).
Home / EndJump to the first / last option while open.
EnterToggle the active option; the popup stays open.
BackspaceWith an empty query, remove the last selected value.
EscClose the popup.
  • Implements the ARIA 1.2 multiselect combobox: the `role="combobox"` input keeps focus while `aria-activedescendant` points at the highlighted `role="option"`.
  • The listbox is `aria-multiselectable="true"`; selected options expose `aria-selected="true"` and gated options `aria-disabled`.
  • Additions, removals, and clears are announced through a polite live region.

MultiSelect props

PropTypeDefaultDescription
aria-labelstringAccessible label for the input (required if no visible label wraps it).
classNamestringMerged after the pds class on the root field.
clearablebooleanfalseShow a clear button once anything is selected.
defaultValuestring[]Initial selected values in uncontrolled mode.
disabledbooleanfalseDisable the control.
filter((options: MultiSelectOption[], query: string) => MultiSelectOption[])(options: MultiSelectOption[], query: string): MultiSelectOption[] => { const q = query.trim().toLowerCase(); if (!q) return options; return options.filter((o) => o.label.toLowerCase().includes(q)); }Custom filter predicate; defaults to case-insensitive label substring match.
idstringRoot id — also seeds the listbox/option ids.
invalidbooleanfalseMark the field invalid — danger border plus `aria-invalid`.
maxnumberMaximum number of selections. Options beyond it are disabled.
onValueChange((value: string[]) => void)Fires with the next list whenever a value is toggled or removed.
options *MultiSelectOption[]The full option set.
placeholderstringSelect…Placeholder for the entry (shown only while nothing is selected).
sizeenummdControl height: `sm` (32) · `md` (36, default) · `lg` (40) — the minimum row height.
valuestring[]Controlled selected values.

Related

  • ComboboxAutocomplete field — a sunken input that filters a list as you type, following the ARIA 1.2 combobox pattern.
  • SelectInput-styled trigger plus an overlay panel for choosing one value from a list; flat or compound API.
  • TagsInputA token / multi-value field: typed values commit into dismissible Tags inside a sunken input container, with dedupe, max, and validation.
  • FieldForm-field wrapper: a caption label, the control, and hint or error messaging with ARIA wired for you.