Mount Toaster in a client-visible layout and call the imperative toast API from interactions. Server rendering is an empty no-op and does not retain notifications between requests.
pnpm dlx shadcn@latest add @tile-ui/sonner
import { toast, Toaster } from '@tile-ui/solid';
<><button type="button" onClick={() => toast.success("Saved")}>Notify</button><Toaster richColors /></>
- Imperative toast variants and updates
- Dismiss lifecycle and external-store subscriptions
- Empty server output with no cross-request store leakage
| Item |
Purpose |
sonner |
Component source and module styles |
core |
Framework-agnostic logic helpers |
utils |
Shared utility helpers |
styles |
Shared SCSS tokens and globals |
| Prop |
Type |
Default |
position |
'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center' |
— |
duration |
number |
— |
closeButton |
boolean |
— |
richColors |
boolean |
— |
theme |
'light' | 'dark' | 'system' |
— |
| Prop |
Type |
Default |
call |
(title: string, options?: SonnerAddInput) => string |
— |
success / info / warning / error / loading |
(title: string, options?: SonnerAddInput) => string |
— |
update |
(id: string, update: SonnerToastUpdate) => void |
— |
dismiss |
(id?: string) => void |
— |
| Prop |
Type |
Default |
return |
UseToastReturn |
— |