Toast stack
Stack short results at the edge until you reach for them.
npx shadcn@latest add @silicon-ui/toast-stackInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/toast-stackManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/toast-stack/toast-stack.tsx
- components/silicon-ui/toast-stack/toast-stack.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
ToastStack
| Prop | Type | Default |
|---|---|---|
labelAccessible name of the notification region. | string | "Notifications" |
position | "bottom-right" | "bottom-center" | "bottom-left" | "bottom-right" |
containedPins the stack inside the nearest positioned ancestor instead of the window, for panels and previews. | boolean | false |
visibleToastsHow many toasts show at once. Older ones wait behind and return as the front ones close. | number | 3 |
hotkeyAlt+T moves focus into the stack. | boolean | true |
className | string | — |
ToastStackProvider
| Prop | Type | Default |
|---|---|---|
children* | ReactNode | — |
durationBase lifetime in milliseconds. Warnings and errors stay 1.6 times longer. | number | 5000 |
limitOldest toasts beyond this count are dropped from the queue. | number | 12 |
Dependencies
- npm
- lucide-reactmotion
- Registry
- silicon-motion-tokens