Confirm morph
CoreA 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.jsonAPI Reference
| Prop | Type | Default |
|---|---|---|
label* | ReactNode | required |
icon | ReactNode | — |
prompt | ReactNode | — |
confirmLabel | string | — |
cancelLabel | string | — |
pendingLabel | string | — |
doneLabel | string | — |
errorLabel | string | — |
retryLabel | string | — |
undoLabel | string | — |
undoingLabel | string | — |
tone | "danger" | "neutral" | — |
confirmMode | ConfirmMorphMode | — |
holdDuration | number | — |
countdown | number | — |
countdownLabel | string | — |
onConfirm | () => void | Promise<unknown> | — |
onUndo | () => void | Promise<unknown> | — |
onCancel | () => void | — |
state | ConfirmMorphState | — |
defaultState | ConfirmMorphState | — |
onStateChange | (state: ConfirmMorphState) => void | — |
confirmTimeout | number | — |
resultTimeout | number | — |
cancelOnOutsidePress | boolean | — |
disabled | boolean | false, className, ref |
className | string | — |
ref | Ref<HTMLDivElement> | — |