API reference
components/undo-toast
Import
Section titled “Import”import * as api from "@fungi.computer/caps/components/undo-toast";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | UndoToastOptions | What an undo toast says and does. |
| function | toastUndo() | Show a done-and-undoable toast: the action is deferred while a fuse burns along the toast’s edge, Undo or Escape cancels it, and resting on the toast holds the fuse. Returns the toast id. |
UndoToastOptionstype alias
Section titled “UndoToastOptions”type UndoToastOptions = Readonly<{ title: ReactNode; description?: ReactNode; onCommit: () => void; onUndo?: () => void; undoLabel?: string; undoMs?: number; toasterId?: string;}>;What an undo toast says and does.
toastUndo()function
Section titled “toastUndo()”function toastUndo(options): string | number;Show a done-and-undoable toast: the action is deferred while a fuse burns along the toast’s edge, Undo or Escape cancels it, and resting on the toast holds the fuse. Returns the toast id.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
UndoToastOptions |
Returns
Section titled “Returns”string | number