Skip to main content

Examples

Action Copy

All Types

Positive

Custom Label

Removed

Props

UndoAlertPrompt

A compact, auto-dismissing confirmation with a single undo action. Use it straight after a reversible change, such as moving or deleting an item, so the user can reverse it without leaving their flow. The copy is not fixed: pass a title describing the action that just happened, and pick type by outcome (removed for deletions, positive for everything else). Use inside a ToastProvider with a ToastViewport.
() => void
required
Called when the user activates the undo button. The prompt closes afterwards.
ReactNode
required
Confirmation of the action that just completed. Write it for the action being undone, e.g. “Folder deleted”, “Template moved” or “3 messages archived”. Accepts rich content for emphasising an item name.
boolean
"positive" | "removed"
default:"positive"
Outcome being confirmed. Drives the leading icon.
string
default:"undoLabel"
Describes an alternative way to undo, announced to screen reader users who cannot reach the button before the prompt dismisses. Word it for the action, e.g. “Restore the folder from Recently deleted”.
string
default:"Undo"
Label for the undo button.

Exported types

Also exported from @fanvue/ui: UndoAlertPromptProps, UndoAlertPromptType.
Setup: Installation · Theming