Approval questionsPro
Paged questions the agent asks before acting: an odometer counter, single choice that moves on by itself, multi-select, your own answer, Skip and Send.
oxyn add approval-questionsThe 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
- Before acting, the agent needs a few answers: how many flavours, which mix-ins, which market first.
- One question at a time, quick to answer, with room for "something else".
When not to use
- An agent's question in its own card above the composer: use Decision Card instead.
- An agent asks before it acts: use Approval Card instead.
- Several open requests in one card: use Approval pager instead.
Installation
Approval questions 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 approval-questionsUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Paged
Three questions, 1 / 3.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Review
A review page before Send (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Timeout
Answers Recommended after 20 s (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ApprovalQuestions
| Prop | Type | Default | Description |
|---|---|---|---|
questionsrequired | Vec<Question> | — | Questions. |
skip_label | String | "Skip" | Skip label. |
continue_label | String | "Continue" | Continue label. |
send_label | String | "Send" | Send label. |
custom_placeholder | String | "Something else…" | Custom answer placeholder. |
sent_message | String | "Answers sent" | Sent message. |
resettable | bool | true | Offer Start over after sending. |
review | bool | Default::default() | Oxyn plus: review page before Send. |
timeout_s | Option<u32> | Default::default() | Oxyn plus: answer with Recommended after this many seconds. |
on_submitted | EventHandler<Vec<String>> | — | Sent: one answer per question (`"1,3"`, `"text: …"`, `"skipped"`). |
on_answer_change | EventHandler<(usize, String)> | — | An answer changed: `(question index, answer)`. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Enter | Continue (Send on the last question) |
| ClickorSpace on an option | Pick; single choice moves on after 480 ms |
| Esc | Dismiss |
Accessibility
- Single choice is a radiogroup, multi-select a group of checkboxes; the counter is named “Question 1 of 3”.
- The card is aria-live=polite so each new question is read.
- Prev, Next and Dismiss are labelled icon buttons.
From the spec
Single choice is a radiogroup of radios, multi a group of checkboxes, both named by the question. The counter reads "Question 1 of 3". The card is aria-live=polite, so each new question is read. Prev, Next and Dismiss are labelled icon buttons.
Motion & interaction
The step counter rolls like an odometer (up when moving forward). Pages slide vertically with a 360 ms ease and the card's height fits the active page. Single choice auto-advances after 480 ms so the pick is seen first. The dark button's label crossfades to Send on the last page.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Counter roll | 350 ms (400 ms total) | cubic-bezier(.4,0,.2,1) | swap |
| Page slide + height | 360 ms | cubic-bezier(.22,1,.36,1) | 1 ms |
| Auto-advance | 480 ms after a single pick | — | same delay |
| Dot / tick | ox-snap / 220 ms draw | ease.out | instant |
Responsive behaviour
- Fills its container up to 460 px; option rows wrap their text.
Edge cases (spec)
Questions without a custom row (allow_text = false). Going back keeps answers and focuses the picked option. A custom answer on a multi question is kept alongside picks. Long questions wrap; the card is up to 460 px and fills smaller containers.
Notes for AI
- Import
ApprovalQuestionsfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
ApprovalQuestionsElinoxyn_gpui. - Props to set first:
questions. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.