Multi-selectPro
Several values in a compact field: chips that grow in, a rolling +N, drawn checks in the list and a Clear button.
oxyn add multi-selectThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Several values in a compact field that looks like a select: which tools an agent may use, which repositories a run touches.
- The user opens a list, ticks a few, and wants the trigger to stay one line tall.
When not to use
Installation
Multi-select is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add multi-selectUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Default
Three picked, two chips and +1.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Closed
Closed trigger.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Select all
Select all row (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Capped
Max with a reason (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
MultiSelect
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | String | — | Label (also names the listbox). |
optionsrequired | Vec<ComboOption> | — | Options. |
value | Vec<String> | Default::default() | Starting values. |
placeholder | String | "Select options" | Placeholder. |
description | Option<String> | Default::default() | Helper copy. |
max_visible | usize | 2 | Chips before `+N`. |
select_all | bool | Default::default() | Select all row. |
max_selected | Option<usize> | Default::default() | Max picks. |
open | bool | Default::default() | Start open (review sheets). |
disabled | bool | Default::default() | Disabled. |
on_change | EventHandler<Vec<String>> | — | Changed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpace | Open or close; Enter toggles the active option while open |
| ↓or↑ | Open, then move through enabled options (wraps) |
| HomeorEnd | First / last option |
| Esc | Close |
Accessibility
- Trigger: aria-haspopup=listbox, aria-expanded, labelled by the label and a hidden list of the picked labels.
- The menu is role=listbox with aria-multiselectable; options carry aria-selected and aria-disabled.
- Clear is labelled “Clear selections”; chips are aria-hidden in favour of the spoken summary.
From the spec
The trigger is a button with aria-haspopup=listbox; its name is the label plus a visually hidden comma-joined list of picked labels (chips are aria-hidden). The menu is a listbox with aria-multiselectable; options carry aria-selected / aria-disabled. Changes are announced politely ("Added Shell, 3 selected").
Motion & interaction
Chips grow in from the left; +N rolls as the count changes; the box fills and its tick draws; the menu lifts in from the trigger. Clear collapses the chips together.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Chip grow | 200 ms | ease.out | 1 ms |
+N roll | 200 ms | ease.out | swap |
| Check | 220 ms fill + 240 ms draw | ease.out | drawn |
| Menu | 180 ms | ease.out | 80 ms fade |
Responsive behaviour
- Chips cap at 9rem and ellipsize; max_visible keeps the trigger on one line.
- The menu spans the field; keep lists short on small screens.
Edge cases (spec)
Chips cap at 9 rem with ellipsis; max_visible keeps the trigger one line. Everything disabled: the list shows but nothing toggles. Long lists scroll; the active row stays in view. Narrow screens: the menu spans the field.
Notes for AI
- Import
MultiSelectfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
ComboboxElinoxyn_gpui. - Props to set first:
label,options. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.