Skip to content
Back

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-questions
1 / 3
How many flavors should we launch?
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

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

Terminal
oxyn add approval-questions

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

Paged

Three questions, 1 / 3.

1 / 3
How many flavors should we launch?
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

Review

A review page before Send (Oxyn plus).

1 / 3
How many flavors should we launch?
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

Answers Recommended after 20 s (Oxyn plus).

1 / 3
How many flavors should we launch?
Answers “Three (core line)” in 20s
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

ApprovalQuestions

PropTypeDefaultDescription
questionsrequiredVec<Question>—Questions.
skip_labelString"Skip"Skip label.
continue_labelString"Continue"Continue label.
send_labelString"Send"Send label.
custom_placeholderString"Something else…"Custom answer placeholder.
sent_messageString"Answers sent"Sent message.
resettablebooltrueOffer Start over after sending.
reviewboolDefault::default()Oxyn plus: review page before Send.
timeout_sOption<u32>Default::default()Oxyn plus: answer with Recommended after this many seconds.
on_submittedEventHandler<Vec<String>>—Sent: one answer per question (`"1,3"`, `"text: …"`, `"skipped"`).
on_answer_changeEventHandler<(usize, String)>—An answer changed: `(question index, answer)`.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterContinue (Send on the last question)
ClickorSpace on an optionPick; single choice moves on after 480 ms
EscDismiss

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
TransitionDurationEasingReduced motion
Counter roll350 ms (400 ms total)cubic-bezier(.4,0,.2,1)swap
Page slide + height360 mscubic-bezier(.22,1,.36,1)1 ms
Auto-advance480 ms after a single pick—same delay
Dot / tickox-snap / 220 ms drawease.outinstant

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 ApprovalQuestions from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: ApprovalQuestionsEl in oxyn_gpui.
  • Props to set first: questions.
  • 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