Card
A content card with media, byline, status and an action that opens into a quick look; hover lifts it and zooms the media; status changes roll in word by word.
oxyn add cardTwo tabs refreshed at once and logged the user out. The agent added a single-flight lock.
Newsletter send
Waiting for your approval to email 12,480 subscribers.
rsx! {
Card {
title: "Refresh-token race",
description: "Two tabs refreshed at once…",
media: "grid",
meta: "Maya Chen",
status: "Updated 2 minutes ago",
action: "Review",
details: "Fix: wrap refresh() in a mutex…",
edge: "working",
}
}Rendered from Rust at build time · goes live when visible
When to use
- A unit of work in a grid or list: a run, a PR, a document, a send waiting for approval.
- It shows enough to choose, and opens into a quick look for the rest.
When not to use
- A modal window on a dimmed backdrop: use Dialog instead.
- An agent's code review in one card: use Review card instead.
- A dense card that gives itself more room on request: use Expandable card instead.
Installation
Card is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add carduse crate::oxyn::{Card, PRIMITIVES_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{Card, PRIMITIVES_CSS};
Usage
rsx! {
Card {
title: "Refresh-token race",
description: "Two tabs refreshed at once…",
media: "grid",
meta: "Maya Chen",
status: "Updated 2 minutes ago",
action: "Review",
details: "Fix: wrap refresh() in a mutex…",
edge: "working",
}
}Examples
Working
An agent is working on it: a beam runs round the border.
Two tabs refreshed at once and logged the user out. The agent added a single-flight lock.
Newsletter send
Waiting for your approval to email 12,480 subscribers.
Code
rsx! {
Card {
title: "Refresh-token race",
description: "Two tabs refreshed at once…",
media: "grid",
meta: "Maya Chen",
status: "Updated 2 minutes ago",
action: "Review",
details: "Fix: wrap refresh() in a mutex…",
edge: "working",
}
}Quick look
Opened into the quick look.
Two tabs refreshed at once and logged the user out. The agent added a single-flight lock.
Refresh-token race
Maya Chen
Newsletter send
Waiting for your approval to email 12,480 subscribers.
Code
rsx! {
Card {
title: "Refresh-token race",
description: "Two tabs refreshed at once…",
media: "grid",
meta: "Maya Chen",
status: "Updated 2 minutes ago",
action: "Review",
details: "Fix: wrap refresh() in a mutex…",
}
}Selectable
Pick cards for a batch action.
Two tabs refreshed at once and logged the user out. The agent added a single-flight lock.
Newsletter send
Waiting for your approval to email 12,480 subscribers.
Code
rsx! {
Card {
title: "Refresh-token race",
description: "Two tabs refreshed at once…",
media: "grid",
meta: "Maya Chen",
status: "Updated 2 minutes ago",
action: "Review",
details: "Fix: wrap refresh() in a mutex…",
selectable: true,
}
}Row
Compact list row.
Two tabs refreshed at once and logged the user out. The agent added a single-flight lock.
Code
rsx! {
Card {
title: "Refresh-token race",
description: "Two tabs refreshed at once…",
media: "grid",
meta: "Maya Chen",
status: "Updated 2 minutes ago",
action: "Review",
details: "Fix: wrap refresh() in a mutex…",
edge: "done",
layout: "row",
}
}API reference
Card
| Prop | Type | Default | Description |
|---|---|---|---|
titlerequired | String | — | Title (opens the quick look when `details` is set). |
description | Option<String> | Default::default() | Line under the title. |
media | Option<String> | Default::default() | Media: an image URL, or a pattern (`grid`, `dots`, `waves`). |
meta | Option<String> | Default::default() | Owner name (avatar + byline). |
status | Option<String> | Default::default() | Status under the byline (rolls in when it changes). |
action | Option<String> | Default::default() | Footer action label. |
details | Option<String> | Default::default() | Quick look text. |
open | bool | Default::default() | Quick look open. |
edge | String | "none" | Oxyn plus: `none` · `working` · `attention` · `done` · `error`. |
selectable | bool | Default::default() | Oxyn plus: selectable. |
layout | String | "card" | Oxyn plus: `card` · `row`. |
width | f32 | 300.0 | Width px (a definite width keeps the grid cell steady). |
children | Element | Default::default() | Extra body. |
on_open_change | EventHandler<bool> | — | Quick look changed. |
on_action | EventHandler<()> | — | Action pressed. |
on_select | EventHandler<bool> | — | Selection changed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpace | On the title: open the quick look |
| Esc | Close it; focus returns to the title |
| Tab | Trapped inside the open quick look |
Accessibility
- An article named by its h3 title; only the title is a button, so nested actions stay separate.
- Status changes are read through a polite status region.
From the spec
Only the title is a button, so the action stays a separate tab stop. The quick look is a modal dialog that returns focus to the title. Status changes are read through a polite region.
Motion & interaction
Hover lifts 2 px and zooms the media over 1.2 s. Status changes roll in word by word (only the changed words move). The working edge is a light beam that circles the border.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Lift | 220 ms | ease.out | none |
| Media zoom | 1.2 s | ease.out | none |
| Status words | 260 ms + 50 ms stagger | ease.out | swap |
| Quick look | 240 ms | ease.out | 120 ms fade |
| Beam | 2.4 s / turn | linear | 4 s / turn |
Responsive behaviour
- A definite width that never exceeds its cell; hover lift and zoom only for a fine pointer.
Edge cases (spec)
A definite width keeps grid cells steady; long titles wrap to two lines. No media collapses the band. Touch skips hover effects.
Notes for AI
- Import
Cardfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
CardElinoxyn_gpui. - Props to set first:
title. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.