Changelog
What changed in each release. Registry items always install the latest version.
New gestures, three new components, four new blocks and docs search. @sureui is in the shadcn registry index, so npx shadcn add @sureui/<item> works with no setup. Some options were renamed or removed; see Breaking.
New components
ToolApprovalandToolApprovalBatchapprove AI SDK tool calls with a gesture that matches the risk, with optional once, session and always scopes.notesends a line of text to the agent asreason.useUnsavedChangesasks before unsaved changes are lost: when leaving a page, before a Dialog, Sheet or Drawer closes, and on reload. It can offer Save.ConfirmSwitchis back. It flips right away and can be flipped back during the undo window, with a thumb or ring indicator.
New options
gesture="slide": drag to the end and let go to confirm. Two clicks also confirm, so nobody has to drag.wait: confirm stays disabled for a few seconds, counting down on the button ("Wait 3s").armDelayignores activation for a moment after the button appears or arms.onConfirmErroranderrorLabelshow an error with retry instead of rethrowing.undo="manual"is an undo with no timer.Consequencesitems takefromandtofor changes ("Plan: Pro → Free"), andsubjectnames the thing being deleted.- ConfirmDialog takes an
alternative("Archive instead"), several typed phrases, andchoicescheckboxes. ConfirmDialog and ConfirmPopover takeinitialFocus. - Undoable takes
focusAfterRemove. - Every label and title accepts any React node.
Breaking
- undoToast's
pauseOnHoverandpauseOnFocusare nowpauseUndoOnHoverandpauseUndoOnFocus. fill.tsandundo-window.tsare merged intoconfirmation.ts. After updating, delete the two old files fromcomponents/ui/sureui/.confirmOnRelease,releaseLabel, thereadystate andannouncements.readyare removed. A hold confirms when the fill completes.cancelOnBlurandcancelHoldOnLeaveare removed. An armed control always disarms when focus leaves, and a hold always cancels when the pointer leaves.- ConfirmPopover's
showCancel, ConfirmMenuItem'scloseOnUndoandcommitUndoOnClose, and the per-rowlimit,expandable,moreLabelandlessLabelon Consequences items are removed. - TypeToConfirm's
variantnow defaults to"default", like every other control. Passvariant="destructive"to keep it red.
Behavior
- An armed hold is labeled, and Android holds no longer arm on release.
- Letting go of Space or Enter early cancels a hold instead of arming it.
- ConfirmDialog shows
acknowledgementswithout aphrasetoo. With analternative, Cancel and Confirm share a row and the alternative gets its own full-width row. - ToolApproval's critical approve is disabled while a response is sending.
- Undoable sets
data-errorafter a failedonConfirm.
Blocks
- New: agent-approval-01, bulk-actions-01, settings-save-bar-01 and cancel-subscription-01. danger-zone-01's Transfer dialog now shows what changes.
- Back: danger-zone-01, api-keys-01, delete-account-01, team-members-01, file-manager-01 and inbox-01.
Docs
- Search with ⌘K, Ctrl+K or
/. - A Choosing a confirmation guide, including friction that grows with the count for bulk actions.
- Examples show only their component, and the strip under each preview shows what ran, like
deleteProject(). Timings and toggles can be changed in the preview. - Every WCAG claim links to its W3C page.
- llms.txt lists the exact install command for every item.
- Confirmation Core documents
useConfirmationfor building your own control. - An agent skill for Claude Code, Cursor, Codex and other agents:
npx skills add aidankmcalister/sureui.
A redesigned Consequences, a pulse while controls are pending, and new docs. ConfirmSwitch is removed for now.
Changes
Consequencesis now a ledger: one row per item with the count on the right and names underneath. Labels read as row headings, so pass them capitalized, likeDeployments.Consequencescounts the names when you don't passcount, andvariant="destructive"tints the whole list.- Controls pulse while an async
onConfirmis pending, instead of dimming. Withprefers-reduced-motionthey dim as before.
Removed
ConfirmSwitchis out of the registry while it's reworked. Installed copies keep working.
Docs
- One page per component, each with live examples, a props table and a table of contents.
- Old style pages like
/docs/undoand/docs/holdredirect to their component page.
The first release: nine registry items for shadcn/ui on Base UI, all built on one confirmation core.
Components
ConfirmButtonconfirms on a click, a second click or a press and hold, with optional inline undo.ConfirmMenuItembrings the same gestures to dropdown and context menu items. The menu stays open until the action commits.TypeToConfirmunlocks only after the exact phrase is typed and every acknowledgement is checked.caseSensitiveandtrimcontrol how the phrase matches.ConfirmDialogputs aConfirmButtonorTypeToConfirmin an alert dialog.useConfirmreturns an awaitableconfirm().ConfirmPopoveranchors a one-line confirm to any trigger.ConfirmSwitchasks before the risky direction of a switch and toggles the other way at once.Consequenceslists what a confirmation will remove, with counts and names.undoToast(message)shows a Sonner toast with Undo and resolvestrueonly if nobody undoes.Undoablecollapses a removed row in place to a label and an Undo button.
Behavior
onConfirmcan return a promise. The control stays pending and keeps focus until it settles, and goes back to idle if it throws.- Undo windows pause on hover, on keyboard focus and while the tab is hidden. Each pause can be turned off per control.
- A hold confirms when you let go (
confirmOnRelease), andholdFallbacklets screen reader and keyboard users confirm it with a second click. - A quick double click confirms
click-again, and an armed button disarms when focus leaves (cancelOnBlur). - Undo is announced to screen readers, and key repeat can't confirm or undo anything.
- Every label and announcement is a prop.
- Undo windows are kept between 4 and 60 seconds, and other durations are capped at 60 seconds.