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-confirmThe 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
- 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.
oxyn add inline-confirmUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Press
Press Delete to confirm.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Hold
Hold Delete while it fills.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Countdown
Confirm, then 3 s you can still cancel.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Error
The action fails: Retry.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Done
Result with Undo.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
InlineConfirm
| Prop | Type | Default | Description |
|---|---|---|---|
modelrequired | MorphModel | — | Model. |
nowrequired | ClockMs | — | Shared clock. |
icon | String | "trash" | Icon before the resting label. |
on_open | EventHandler<()> | — | Resting button pressed. |
on_confirm | EventHandler<()> | — | Confirm pressed (press and countdown modes) or Retry. |
on_cancel | EventHandler<()> | — | Cancel, Escape or stop the countdown. |
on_undo | EventHandler<()> | — | Undo pressed. |
on_hold | EventHandler<bool> | — | Hold on Confirm started or ended (hold mode). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Enter | Confirm |
| Escape | Cancel 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
InlineConfirmfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
InlineConfirmElinoxyn_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.