Skip to content
caliper ui pro docs

Confirm morph

A destructive action that morphs into its own confirmation. The question drains a timer along its foot and the undo drains a ring; both pause while you are inside, and focus stays with the control as it changes.

Pro

When to use

  • Deleting or removing one thing where a dialog would be heavy.
  • You want pending, done, error and undo states in one control.

When not to use

  • The action is routine and harmless; use a button.
  • The action is catastrophic; use hold to confirm or a dialog.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/confirm-morph

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

ConfirmMorph

18 props
PropTypeDefault
label *ReactNode—
iconReactNode—
promptReactNode—
confirmLabelstring"Delete"
cancelLabelstring"Cancel"
pendingLabelstring"Deleting"
doneLabelstring"Deleted"
errorLabelstring"Couldn’t finish"
retryLabelstring"Retry"
undoLabelstring"Undo"
tone"neutral" | "danger""danger"
onConfirm(() => void | Promise<void>)—
onUndo(() => void | Promise<void>)—
onCancel(() => void)—
confirmTimeoutnumber6000
resultTimeoutnumber5000
disabledbooleanfalse
classNamestring—

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It exposes group semantics, with aria-hidden, aria-busy, aria-label and aria-live kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/confirm-morph.md

The index of every part is at /llms.txt.

More in Actions