API reference: @salmonui/notifications/toast
ToastActioninterface
import type { ToastAction } from '@salmonui/notifications/toast';interface ToastAction {
label: ReactNode;
altText: string;
onAction?: ((event: MouseEvent<HTMLButtonElement>) => void) | undefined;
}
A button in the toast.
| Name | Signature | Description |
|---|---|---|
label | label: ReactNode; | The visible button label. |
altText | altText: string; | Keyboard hint announced with the toast, for example "Undo with F6 then Enter". Required: the toast may be gone before a pointer reaches it. |
onActionoptional | onAction?: ((event: MouseEvent<HTMLButtonElement>) => void) | undefined; | Runs on press; the toast then closes with reason |