Skip to content

Changelog

What changed in each release. Registry items always install the latest version.

0.2.0

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

  • ToolApproval and ToolApprovalBatch approve AI SDK tool calls with a gesture that matches the risk, with optional once, session and always scopes. note sends a line of text to the agent as reason.
  • useUnsavedChanges asks before unsaved changes are lost: when leaving a page, before a Dialog, Sheet or Drawer closes, and on reload. It can offer Save.
  • ConfirmSwitch is 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").
  • armDelay ignores activation for a moment after the button appears or arms.
  • onConfirmError and errorLabel show an error with retry instead of rethrowing.
  • undo="manual" is an undo with no timer.
  • Consequences items take from and to for changes ("Plan: Pro → Free"), and subject names the thing being deleted.
  • ConfirmDialog takes an alternative ("Archive instead"), several typed phrases, and choices checkboxes. ConfirmDialog and ConfirmPopover take initialFocus.
  • Undoable takes focusAfterRemove.
  • Every label and title accepts any React node.

Breaking

  • undoToast's pauseOnHover and pauseOnFocus are now pauseUndoOnHover and pauseUndoOnFocus.
  • fill.ts and undo-window.ts are merged into confirmation.ts. After updating, delete the two old files from components/ui/sureui/.
  • confirmOnRelease, releaseLabel, the ready state and announcements.ready are removed. A hold confirms when the fill completes.
  • cancelOnBlur and cancelHoldOnLeave are removed. An armed control always disarms when focus leaves, and a hold always cancels when the pointer leaves.
  • ConfirmPopover's showCancel, ConfirmMenuItem's closeOnUndo and commitUndoOnClose, and the per-row limit, expandable, moreLabel and lessLabel on Consequences items are removed.
  • TypeToConfirm's variant now defaults to "default", like every other control. Pass variant="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 acknowledgements without a phrase too. With an alternative, 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-error after a failed onConfirm.

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 useConfirmation for building your own control.
  • An agent skill for Claude Code, Cursor, Codex and other agents: npx skills add aidankmcalister/sureui.

0.1.1

A redesigned Consequences, a pulse while controls are pending, and new docs. ConfirmSwitch is removed for now.

Changes

  • Consequences is 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, like Deployments.
  • Consequences counts the names when you don't pass count, and variant="destructive" tints the whole list.
  • Controls pulse while an async onConfirm is pending, instead of dimming. With prefers-reduced-motion they dim as before.

Removed

  • ConfirmSwitch is 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/undo and /docs/hold redirect to their component page.

0.1.0

The first release: nine registry items for shadcn/ui on Base UI, all built on one confirmation core.

Components

  • ConfirmButton confirms on a click, a second click or a press and hold, with optional inline undo.
  • ConfirmMenuItem brings the same gestures to dropdown and context menu items. The menu stays open until the action commits.
  • TypeToConfirm unlocks only after the exact phrase is typed and every acknowledgement is checked. caseSensitive and trim control how the phrase matches.
  • ConfirmDialog puts a ConfirmButton or TypeToConfirm in an alert dialog. useConfirm returns an awaitable confirm().
  • ConfirmPopover anchors a one-line confirm to any trigger.
  • ConfirmSwitch asks before the risky direction of a switch and toggles the other way at once.
  • Consequences lists what a confirmation will remove, with counts and names.
  • undoToast(message) shows a Sonner toast with Undo and resolves true only if nobody undoes.
  • Undoable collapses a removed row in place to a label and an Undo button.

Behavior

  • onConfirm can 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), and holdFallback lets 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.