Notification
Toast Stack
A stack of toasts that spring in, tuck behind each other and expand on hover.
npx motionsnack add toast-stackCustomize
Accent
<ToastStack />Props
18 properties
| Property | Type | Default | Description |
|---|---|---|---|
| toasts | { id?: string; title: string; description?: string; variant?: 'info' | 'success' | 'warning' | 'error'; action?: { label: string; href?: string } }[] | 4 demo messages | Messages shown by the trigger, in a loop. Errors never time out; toasts with an action stay 10000ms. |
| trigger | ReactNode | - | Content of the trigger button (replaces triggerLabel). |
| onAction | (message) => void | - | Called with the message whose action was pressed. |
| hotkey | string | 'F8' | Key that moves focus into the stack. |
| labels | { region?: string; dismiss?: string } | 'Notifications', 'Dismiss' | UI strings. |
| onShow | (message, index) => void | - | Called whenever the trigger shows a toast. |
| className | string | '' | Extra classes on the component's box. |
| triggerLabel | string | 'Show notification' | Text of the trigger button. An empty string hides the button. |
| position | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'bottom-right' | Corner (or edge centre) of the component's box the toasts stack in. |
| duration | number | 5000 | Milliseconds before a plain toast dismisses itself. 0 keeps it until it is closed. |
| maxVisible | number | 3 | Most toasts visible at once; the rest wait in a queue. |
| initialCount | number | 1 | Toasts shown on first render. Their countdown starts with the first press of the trigger. |
| showProgress | boolean | true | Thin line at the bottom of a toast showing the time left. |
| closable | boolean | true | Close button on every toast. |
| expandOnHover | boolean | true | Hovering or focusing the stack spreads the toasts out into a list. |
| pauseOnHover | boolean | true | Countdown waits while the stack is hovered or focused. |
| accent | string | '' | Colour of the progress line. Empty keeps it monochrome. |
| height | number | 420 | Height of the component's box. |
About Toast Stack
A trigger button and a stack of toasts anchored to a corner of the component's own box. Every new toast springs in from the edge while the older ones scale down and tuck behind it, so only a thin strip of each stays visible. Hovering or focusing the stack spreads the toasts out into a readable list and pauses their countdown. Each toast dismisses itself after a set time, shown by a thin progress line in the accent colour, and can be closed by hand. The demo cycles through a list of preset messages you pass in as an array. With reduced motion the toasts simply fade.
What's included
- Spring enter, stacked scale and offset for older toasts
- Expands into a list on hover or focus
- Auto dismiss with a progress line that pauses on hover
- Six positions inside the component's box
- Messages as an array prop, cycled by the trigger
- Close buttons, live region and focus return
- Light and dark, reduced motion respected
- Type
- Animated React notification component
- Library
- Components · Notification
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-09-20
- Install
npx motionsnack add toast-stack