Confirm morph

Core

A destructive button that morphs into an inline confirmation, a spinner, and a result with undo.

pnpm dlx shadcn@latest add https://wui.alann.works/r/confirm-morph.json

API Reference

PropTypeDefault
label*ReactNoderequired
iconReactNode—
promptReactNode—
confirmLabelstring—
cancelLabelstring—
pendingLabelstring—
doneLabelstring—
errorLabelstring—
retryLabelstring—
undoLabelstring—
undoingLabelstring—
tone"danger" | "neutral"—
confirmModeConfirmMorphMode—
holdDurationnumber—
countdownnumber—
countdownLabelstring—
onConfirm() => void | Promise<unknown>—
onUndo() => void | Promise<unknown>—
onCancel() => void—
stateConfirmMorphState—
defaultStateConfirmMorphState—
onStateChange(state: ConfirmMorphState) => void—
confirmTimeoutnumber—
resultTimeoutnumber—
cancelOnOutsidePressboolean—
disabledbooleanfalse, className, ref
classNamestring—
refRef<HTMLDivElement>—
Categories
actions
Dependencies
lucide-reactmotion