Toast
Notification toast system. Wrap app in ToastProvider and use the useToast() hook to show messages.
Preview
Usage
import { ToastProvider, useToast } from '@ramtt/ui'
// In root layout:
<ToastProvider>{children}</ToastProvider>
// In any component:
const toast = useToast()
toast({ message: 'Saved!', variant: 'success' })Props
| Prop | Type | Default | Description |
|---|---|---|---|
| message* | string | — | Toast text |
| variant | 'default' | 'success' | 'error' | 'warning' | — | Toast style |
| duration | number | 4000 | Auto-dismiss time in ms |
| action | { label: string; onClick: () => void } | — | Action button |