Select
A searchable, multi-select filter. The trigger keeps its label and shows how many are chosen; nothing applies until Apply.
{/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */}
A searchable, multi-select filter. The trigger keeps its label and shows how many are chosen; nothing applies until Apply.
Import
import { Select } from "@ir/ui";Props
| Prop | Type | Required | What it does |
|---|---|---|---|
onValueChange | (value: string[]) => void | Called once, on Apply (or Clear + Apply), with the new selection. | |
label | string | yes | The trigger's label. It stays put when things are selected — the count says how many. |
showDetail | boolean | Show each option's detail (or value) on the right. |
Do and don't
Keep the label ('Filter actions…') and let the count badge say how many.
Don't — Replace the trigger's label with the chosen values.
Three values will not fit a 240px trigger, and a truncated list reads as one value. The label says what the filter is; the count says it is on.
Collect ticks in a draft and commit once on Apply.
Don't — Apply each tick as it happens.
Every tick in a filter re-queries the table behind it. Four live ticks are four reloads and a table jumping under the cursor.
Treat closing without Apply as Cancel.
Don't — Keep a half-finished draft after Escape or a click away.
Someone who closes the menu without applying has changed their mind. Keeping the draft surprises them the next time they open it.
Give options a group, and let search do the rest.
Don't — Show 30 options as one flat list.
Group labels turn scanning into skipping. Past about eight options, people search rather than scroll — the search box is focused on open for that reason.
Use a RadioGroup or a ButtonGroup.
Don't — Use Select for a choice of two or three.
A menu hides the options behind a click. With three, showing them all is faster and needs no search.
Accessibility
- The search is a combobox that owns the list through aria-activedescendant, so focus never leaves it: ArrowUp/Down move, Enter ticks, Ctrl/⌘+Enter applies, Escape closes.
- Options are role=option with aria-selected in an aria-multiselectable listbox. The checkbox is drawn, not a real control, so each row is announced once.
- The count badge is aria-hidden; the trigger's name includes ', N selected' as text.
Where it is drawn
Figma — structure from figma, measurements from figma.