Chip groupPro
Filter chips that morph as you pick them: a check grows in, the label slides, long sets fold behind +N more and selected chips never hide.
oxyn add chip-groupThe 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
- Filter sources, topics or statuses; the mode chips under a composer.
When not to use
- Switch the agent between Ask, Plan and Agent: use Mode switch instead.
- Grouped filters with removable chips, collapsible checkbox groups, Clear all and full keyboard control: use Filter Menu instead.
- A small status label that carries the colour: use Badge instead.
Installation
Chip group 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 chip-groupUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Filters
Source filters folding behind +N more.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Single
Single choice that can still clear.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Soft
Soft chips with counts (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ChipGroup
| Prop | Type | Default | Description |
|---|---|---|---|
optionsrequired | Vec<(String, String)> | — | (value, label). |
labelrequired | String | — | Group name. |
value | Vec<String> | Default::default() | Selected. |
multiple | bool | true | Several at once. |
max_visible | usize | Default::default() | Visible before folding (0 = all). |
counts | Vec<u32> | Default::default() | Count per option (same order). |
variant | String | "outline" | `outline` · `soft`. |
clearable | bool | Default::default() | Clear chip when something is selected. |
on_change | EventHandler<Vec<String>> | — | New selection. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Arrows | Between chips, wrapping |
| HomeorEnd | First / last |
| EnterorSpace | Toggle or open the overflow |
Accessibility
- group with aria-label; chips are buttons with aria-pressed.
- Selected chips always stay visible.
From the spec
group + aria-label; chips are buttons with aria-pressed; roving focus wraps; checks are decorative.
Motion & interaction
Selecting grows a check in and slides the label over; the chip edge springs. Revealed chips stagger in.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Check grow | 200 ms | ease.out | instant |
| Colour | 120 ms | linear | instant |
Responsive behaviour
- Chips wrap onto new lines.
Edge cases (spec)
Chips wrap; selected chips beyond max_visible stay in view so a filter is never hidden.
Notes for AI
- Import
ChipGroupfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
ChipGroupElinoxyn_gpui. - Props to set first:
options,label. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.