Skip to content
API reference

components/undo-toast

Import
import * as api from "@fungi.computer/caps/components/undo-toast";
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”
Signature
type UndoToastOptions = Readonly<{
title: ReactNode;
description?: ReactNode;
onCommit: () => void;
onUndo?: () => void;
undoLabel?: string;
undoMs?: number;
toasterId?: string;
}>;

What an undo toast says and does.

Signature
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.

Parameter Type
options UndoToastOptions

string | number