Skip to content
Back

Inline confirmPro

A destructive button that morphs into an inline question, a spinner and a result with Undo, or an error with Retry. Confirm by press, by hold, or with a countdown Escape can still stop.

oxyn add inline-confirm
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

  • A destructive button that morphs in place: rest → inline question (Cancel / Confirm) → spinner with the pending label → result with Undo, or error with Retry.
  • Confirmation can be a press, a hold on Confirm, or a countdown that Cancel or Escape can still stop.
  • An unanswered question returns to rest after 6 s.

When not to use

  • An agent asks before it acts: use Approval Card instead.
  • Several open requests in one card: use Approval pager instead.
  • An agent's question in its own card above the composer: use Decision Card instead.

Installation

Inline confirm 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 inline-confirm

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

Press

Press Delete to confirm.

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

Hold

Hold Delete while it fills.

Delete 3 files?confirming: Delete 3 files?
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

Countdown

Confirm, then 3 s you can still cancel.

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

Error

The action fails: Retry.

Couldn’t finisherror: Couldn’t finish
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

Done

Result with Undo.

Deleteddone: Deleted
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

InlineConfirm

PropTypeDefaultDescription
modelrequiredMorphModel—Model.
nowrequiredClockMs—Shared clock.
iconString"trash"Icon before the resting label.
on_openEventHandler<()>—Resting button pressed.
on_confirmEventHandler<()>—Confirm pressed (press and countdown modes) or Retry.
on_cancelEventHandler<()>—Cancel, Escape or stop the countdown.
on_undoEventHandler<()>—Undo pressed.
on_holdEventHandler<bool>—Hold on Confirm started or ended (hold mode).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EnterConfirm
EscapeCancel the question or stop the countdown

Accessibility

  • One group; every face keeps a real button so focus never drops to the page.
  • Each change (asking, deleting, deleted, error) is announced in a polite live region.
From the spec
  • role=group named by the resting label; each face keeps a real button so focus is never lost.
  • Face changes are announced in a polite live region (“pending: Deleting”).

Motion & interaction

Timing
  • Width springs between faces (240 ms); the question fades in from a 3 px blur (200 ms).
  • Countdown: one tick per second; hold fill as in hold-to-confirm (1000 ms default).
  • Reduced motion: no width spring or blur; faces swap with a plain fade.

Responsive behaviour

  • Grows inline from the resting button; the question never wraps.
Edge cases (spec)
  • Inline; the question never wraps (white-space: nowrap).

Notes for AI

  • Import InlineConfirm from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: InlineConfirmEl in oxyn_gpui.
  • Props to set first: model, now.
  • It reads a clock (now) for live timers; pass one clock for the whole page rather than one per component.
  • 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