Skip to content

Multi-select

In review
Live · web

Token display: chips + "+N more" overflow, optional inline filter

Open · Space toggles a row · Backspace removes the last · Enter confirms.

Count summary: Select all / Clear all in the header

The header states the running total and offers bulk actions.

Max-selection limit: unchecked rows lock at the cap

Select all fills up to the cap; the rest disable until you remove one.

Disabled: inert, still legible

Inert, but the chosen values stay readable.

Edited the selection 0 times. The island is live.

// Web: React, consuming @dizyx/nockerl-tokens. (Web is the laggard platform. Spec + live demo,
// not yet exported from @dizyx/nockerl-react; promotion is tracked.)
const LABELS = [
{ value: 'bug', label: 'bug', secondary: 'Defect to fix', status: 'error' },
{ value: 'feature', label: 'feature', secondary: 'New capability', status: 'info' },
{ value: 'design', label: 'design', secondary: 'Design framework', status: 'success' },
{ value: 'wontfix', label: 'wontfix', secondary: 'Locked', status: 'idle', disabled: true },
];
export function LabelPicker() {
const [labels, setLabels] = useState<string[]>(['bug', 'feature']);
return (
<MultiSelect
label="Labels"
options={LABELS}
value={labels}
onChange={setLabels}
display="tokens" // removable chips in the field (or "count" → "N selected")
maxTokens={3} // collapse the rest to "+N more"
max={5} // cap: unchecked rows lock once reached
filterable // optional inline filter (secondary, not the headline)
placeholder="Add labels…"
/>
);
}
PropTypeDefaultDescription
label *stringPersistent label above the trigger. Never a placeholder.
options *MultiSelectOption[]Full set. Each: value, label, optional secondary / status / disabled.
value *string[]The selected set (controlled).
onChange *(next: string[]) => voidEmits the next selected set on toggle, select-all, clear-all, or token removal.
display'tokens' | 'count''tokens'tokens = removable chips in the field; count = a "N selected" summary pill.
maxTokensnumber3Tokens shown before collapsing the rest to +N more (tokens mode).
maxnumberSelection cap. Unchecked rows disable once reached; select-all fills up to it.
filterablebooleanfalseShow the optional inline filter input. Secondary: search is the Combobox’s headline, not this control’s.
placeholderstringShown in the field when nothing is selected.
helperTextstringSupporting line under the trigger. Replaced by a warm limit message at the cap.
disabledbooleanfalseInert and clearly seen (never faded to invisible); chosen values stay readable.