Decision CardPro
An agent's question in its own card above the composer: numbered options with one Recommended, tiles for a pick, Approve / Decline with facts, or your own words.
oxyn add decision-cardThe 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
- The agent has paused for the user: which cache, which hero image, may it deploy.
- The question sits in its own card just above the composer so the user can answer in one key and keep working.
When not to use
- Paged questions the agent asks before acting: use Approval questions instead.
- An agent asks before it acts: use Approval Card instead.
- The prompt box for an agent, in six layouts: use Composer instead.
Installation
Decision 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.
oxyn add decision-cardUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Decision
Numbered rows, one Recommended.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Pick
Three tiles.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Approval
Approve or Decline with facts.
- Branch
- fix/proration
- Changes
- +214 −38 in 6 files
- Checks
- All 128 passed
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Folded
Folded to one line.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Timeout
Picks Recommended after 15 s (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
DecisionCard
| Prop | Type | Default | Description |
|---|---|---|---|
decisionsrequired | Vec<Question> | — | Open decisions, oldest first. |
default_folded | bool | Default::default() | Start folded. |
needs_you | String | "Needs you" | Head label. |
timeout_s | Option<u32> | Default::default() | Oxyn plus: answer with Recommended after this many seconds. |
always | bool | Default::default() | Oxyn plus: offer "Always answer this way". |
on_decide | EventHandler<(String, String)> | — | Answered: `(id, answer text)`. |
on_later | EventHandler<String> | — | Folded with Later or Esc. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| 1 – 5 | Answer with that row at once; the next number goes into the field |
| HomeorEnd | First / last row |
| ↑or↓ (← → on tiles) | Move between rows; ↓ from the last row goes into the field |
| EnterorSpace | Answer with the focused row; in the field Enter sends your words |
| Esc | Later: fold the card to one line |
Accessibility
- The card is a group named by the question; rows are a listbox with one tab stop.
- Each row says its number key (aria-keyshortcuts); Later says Escape.
- Answers and Later are announced politely with how many still wait.
From the spec
The card is a group named by the question; rows are a listbox with one tab stop and aria-keyshortcuts per row; Later carries aria-keyshortcuts=Escape. Answers and folds are announced politely with how many still wait. Recommended is text, not colour.
Motion & interaction
The card rises in above the composer. Answered decisions leave at once and the next fades in. The grey head carries "Needs you", the task and Later; the white card holds the rows. reveal pulses the card grey once to draw the eye without colour.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Card rise | 200 ms | ease.out | 1 ms |
| Next decision | 220 ms fade | ease.out | 1 ms |
| Reveal pulse | 700 ms, once | ease-out | none |
| Row hover | 120 ms | ease.out | 80 ms |
Responsive behaviour
- Takes the composer's width; long titles wrap to two lines then end in ….
- Below 420 px tiles turn into rows; touch rows are 44 px.
Edge cases (spec)
Long titles wrap to two lines then end in …. More than five options: numbers stop at 5, the rest are reached by arrows. Narrow (< 420 px): tiles become rows; touch rows are 44 px. An agent that withdraws a decision removes it from the queue; an empty queue folds the card away.
Notes for AI
- Import
DecisionCardfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
DecisionCardElinoxyn_gpui. - Props to set first:
decisions. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.