Skip to content
Back

Expandable cardPro

A dense card that gives itself more room on request: width and height morph together, details fade in after the box has made room, Escape closes from inside.

oxyn add expandable-card
The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • A dense card that gives itself more room on request: a header button with an icon, title and a one-line description (a changed description rises in), and a body that opens.
  • Width (width → expanded_width) and height morph together; details fade in after the box has made room and fade out before it shrinks; the card centres and never exceeds its container (0 fills).
  • Escape closes from inside.

When not to use

  • A modal window on a dimmed backdrop: use Dialog instead.
  • The dialog docked to an edge for inspectors and run details: use Sheet instead.
  • Nested sheets with depth: use Sheet stack instead.

Installation

Expandable card 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.

Terminal
oxyn add expandable-card

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Collapsed

Dense card that grows sideways and down when opened.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Open

Started open.

Services
web      ✓  41s
api      ✓  58s
worker   ✓  35s
Commit 9f2c1ab · triggered by Ada · region iad1
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Fill

Fills its container.

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Failed

A changed description rolls in.

Services
web      ✓  41s
api      ✕  migration 0042 failed
worker   ✓  35s
Commit 9f2c1ab · triggered by Ada · region iad1
Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

ExpandableCard

PropTypeDefaultDescription
titlerequiredString—Title.
descriptionrequiredString—Summary line.
iconString"tool"Icon.
expandedrequiredbool—Expanded.
widthu32Default::default()Collapsed width cap px (0 = fill).
expanded_widthu32Default::default()Expanded width cap px (0 = width).
on_toggleEventHandler<bool>—Toggled.
childrenrequiredElement—Details.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceToggle from the header
EscapeClose from inside, focus stays on the header

Accessibility

  • Header button with aria-expanded; the closed body is aria-hidden.
From the spec
  • Header button with aria-expanded; the closed body is aria-hidden.

Motion & interaction

Timing
  • Width and grid rows move over 320 ms on cubic-bezier(.2,.8,.2,1); details fade in 160 ms after.
  • Reduced motion: no entrance rise or row stagger, no shimmer (static muted text), chevrons and the card morph jump to their end state.

Responsive behaviour

  • Width caps never exceed the container; it centres.
Edge cases (spec)
  • Width caps are max-width 100 %.

Notes for AI

  • Import ExpandableCard from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: ExpandableCardEl in oxyn_gpui.
  • Props to set first: title, description, expanded, children.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI