Skip to content

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 card
MCP

Two tabs refreshed at once and logged the user out. The agent added a single-flight lock.

Maya ChenUpdated 2 minutes ago

Newsletter send

Waiting for your approval to email 12,480 subscribers.

Outreach agentNeeds approval
Dioxus
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.

Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add card
Rust
use 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

Dioxus · rust
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.

Maya ChenUpdated 2 minutes ago

Newsletter send

Waiting for your approval to email 12,480 subscribers.

Outreach agentNeeds approval
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.

Maya ChenUpdated 2 minutes ago

Newsletter send

Waiting for your approval to email 12,480 subscribers.

Outreach agentNeeds approval
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.

Maya ChenUpdated 2 minutes ago

Newsletter send

Waiting for your approval to email 12,480 subscribers.

Outreach agentNeeds approval
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.

Maya ChenUpdated 2 minutes ago
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

PropTypeDefaultDescription
titlerequiredString—Title (opens the quick look when `details` is set).
descriptionOption<String>Default::default()Line under the title.
mediaOption<String>Default::default()Media: an image URL, or a pattern (`grid`, `dots`, `waves`).
metaOption<String>Default::default()Owner name (avatar + byline).
statusOption<String>Default::default()Status under the byline (rolls in when it changes).
actionOption<String>Default::default()Footer action label.
detailsOption<String>Default::default()Quick look text.
openboolDefault::default()Quick look open.
edgeString"none"Oxyn plus: `none` · `working` · `attention` · `done` · `error`.
selectableboolDefault::default()Oxyn plus: selectable.
layoutString"card"Oxyn plus: `card` · `row`.
widthf32300.0Width px (a definite width keeps the grid cell steady).
childrenElementDefault::default()Extra body.
on_open_changeEventHandler<bool>—Quick look changed.
on_actionEventHandler<()>—Action pressed.
on_selectEventHandler<bool>—Selection changed.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterorSpaceOn the title: open the quick look
EscClose it; focus returns to the title
TabTrapped 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
TransitionDurationEasingReduced motion
Lift220 msease.outnone
Media zoom1.2 sease.outnone
Status words260 ms + 50 ms staggerease.outswap
Quick look240 msease.out120 ms fade
Beam2.4 s / turnlinear4 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 Card from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: CardEl in oxyn_gpui.
  • Props to set first: title.
  • 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