Skip to content
Back

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-card
Needs you· Speed up the usage dashboard1 of 3
Where should the dashboard cache live?
1RedisFastest; one more service to run
2Postgres tableRecommendedUses what we have; ~40 ms slower
3Edge KVGlobal, eventually consistent
4No cacheShip the query fix only
↵
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

  • 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.

Terminal
oxyn add decision-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

Decision

Numbered rows, one Recommended.

Needs you· Speed up the usage dashboard1 of 3
Where should the dashboard cache live?
1RedisFastest; one more service to run
2Postgres tableRecommendedUses what we have; ~40 ms slower
3Edge KVGlobal, eventually consistent
4No cacheShip the query fix only
↵
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

Pick

Three tiles.

Needs you· Draft the launch post1 of 3
Which hero image for the launch post?
1Moth over codeDark, on brand
2Team at the boardRecommendedWarm, human
3Product screenshotPlain, clear
↵
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

Approval

Approve or Decline with facts.

Needs you· Fix proration on upgrades1 of 2
Deploy the billing fix to production?
Branch
fix/proration
Changes
+214 −38 in 6 files
Checks
All 128 passed
↵
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

Folded

Folded to one line.

3 decisions waiting
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

Timeout

Picks Recommended after 15 s (Oxyn plus).

Needs you· Speed up the usage dashboard1 of 3
Where should the dashboard cache live?
1RedisFastest; one more service to run
2Postgres tableRecommendedUses what we have; ~40 ms slower
3Edge KVGlobal, eventually consistent
4No cacheShip the query fix only
↵
Picks Postgres table in 15s
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

DecisionCard

PropTypeDefaultDescription
decisionsrequiredVec<Question>—Open decisions, oldest first.
default_foldedboolDefault::default()Start folded.
needs_youString"Needs you"Head label.
timeout_sOption<u32>Default::default()Oxyn plus: answer with Recommended after this many seconds.
alwaysboolDefault::default()Oxyn plus: offer "Always answer this way".
on_decideEventHandler<(String, String)>—Answered: `(id, answer text)`.
on_laterEventHandler<String>—Folded with Later or Esc.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
1 – 5Answer with that row at once; the next number goes into the field
HomeorEndFirst / last row
↑or↓ (← → on tiles)Move between rows; ↓ from the last row goes into the field
EnterorSpaceAnswer with the focused row; in the field Enter sends your words
EscLater: 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
TransitionDurationEasingReduced motion
Card rise200 msease.out1 ms
Next decision220 ms fadeease.out1 ms
Reveal pulse700 ms, onceease-outnone
Row hover120 msease.out80 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 DecisionCard from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: DecisionCardEl in oxyn_gpui.
  • Props to set first: decisions.
  • 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