AccordionPro
Supporting detail revealed in place: the panel height grows while the answer slides down out of a blur, the chevron springs.
oxyn add accordionThe 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
- FAQ and settings sections, and collapsible detail in agent screens (policy, sandbox, billing) read in order.
When not to use
- The thinking of a reply: use Reasoning block instead.
- Long text clamped to a few lines with a soft fade: use Expandable text instead.
- An app sidebar: use Sidebar instead.
Installation
Accordion 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 accordionUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Faq
Single-open questions.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Multiple
Several open, with Expand all (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Page
Large page-level FAQ.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Card
Inside a card with a meta column.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
Accordion
| Prop | Type | Default | Description |
|---|---|---|---|
itemsrequired | Vec<AccordionItem> | — | Rows. |
default_open | Option<usize> | Some(0) | Open on first render (`None` = all closed). |
multiple | bool | Default::default() | Several open at once. |
size | String | "md" | `md` · `lg`. |
variant | String | "plain" | `plain` · `separated` · `card`. |
controls | bool | Default::default() | Expand all / collapse all control (multiple mode). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpace | Toggle the focused row |
| ↑ ↓ | Between triggers |
| HomeorEnd | First / last trigger |
Accessibility
- Triggers sit in h3 with aria-expanded and aria-controls.
- Panels are labelled regions and become visibility:hidden once closed.
From the spec
Triggers in h3, wired with aria-controls / aria-labelledby to region panels; chevrons aria-hidden.
Motion & interaction
The panel grows on a grid-rows transition (retargets mid-flight) while the answer slides down 6 px out of a 2 px blur; the chevron rotates on a snappy spring.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Height | 320 ms | ease.out | instant |
| Answer slide | 320 ms | ease.out | instant |
| Chevron | 260 ms | spring-like overshoot | instant |
Responsive behaviour
- Rows fill the width; lg caps answers at 62ch and tightens below 520px.
Edge cases (spec)
Closed panels stay mounted but visibility:hidden, so they leave the accessibility tree. lg caps answers at 62ch and tightens below 520 px.
Notes for AI
- Import
Accordion,AccordionItemfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
AccordionElinoxyn_gpui. - Props to set first:
items. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.