Feedback
Toast
Short, temporary message at the bottom center after an action, with an optional action like Undo. `ToastProvider` hosts them; `useToast()` shows and dismisses them.
Installation
Install the package (React 19):
terminal
terminal
terminal
Import the styles once, in your app entry or root layout:
/src/main.tsx
Use it anywhere inside your app's <Theme> (see Installation):
/src/ToastExample.tsx
Examples
Static pills
ToastPill is the look without timers or live region, for previews.
Link copied
Changes saved
Moved to Trash
Couldn’t save changesCheck your connection and try again.
Toast options
toast(options) returns the toast id (string | number). Options:
message: ReactNode(required): the main line.description?: ReactNode: a second, smaller line.tone?:"neutral"(default),"success"(green check icon) or"danger"(red error icon, announced assertively).action?:{ label, onClick }, one action button; clicking it runsonClickand dismisses the toast.duration?: number: ms before it hides. Default 4000; 6000 with an action or for danger;0keeps it until dismissed (a close button is shown).icon?: IconName,id?: string | number(Motion extras): custom leading icon; your own id to replace or dismiss a known toast.
API Reference
ToastProvider
Hosts the toasts and the live region. Put it once near the root.
| Prop | Type | Default |
|---|---|---|
children | ReactNode | |
duration | number | 4000 |
label | string | "Notifications ({hotkey})" |
useToast()
Returns { toast, dismiss }. Throws a message naming <ToastProvider> when used outside it.
| Prop | Type | Default |
|---|---|---|
toast | (options: ToastOptions) => string | number | |
dismiss | (id: string | number) => void |
ToastPill
Static toast pill.
| Prop | Type | Default |
|---|---|---|
tone | "neutral""success""danger" | "neutral" |
icon | IconName | |
description | ReactNode | |
action | ReactNode | |
onAction | () => void | |
onClose | () => void |
Accessibility
- Each toast is read out by a live region: neutral and success politely (
role="status"), danger assertively (role="alert"). - Timers pause while the pointer is over a toast or focus is inside the toast region, and while the window is in the background.
- F8 moves focus to the toast region ("Notifications"); Tab reaches the action and close buttons; Escape dismisses the focused toast.
- Swipe down to dismiss on touch screens.
- Give important actions enough time: toasts with an action stay at least 6 seconds; never put the only way to do something in a toast.
- Slides up and fades in, fades out; with reduced motion it only fades.
Usage
- Use to confirm an action that just happened ("Link copied", "Moved to Trash · Undo").
- Use
tone="danger"for failures the user should know about right away; keep the message short and say what to do. - Don't use toasts for information the user must act on or read later: use Alert or a Dialog.
- Show one toast per action; don't stack several for the same event.
© 2026 Motion. Internal documentation.