Toast
Notification system: wrap your app in ToastProvider and call useToast() from anywhere. Stacked, auto-dismissing and pause-on-hover.
Import
import { ToastProvider, useToast, Button } from "@igorao79/uivix";Examples
Types
Trigger toasts of each type
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| position | ToastPosition | "bottom-right" | top/bottom × left/center/right |
| toast | (options | string) => number | - | useToast(): show a toast, returns its id |
| dismiss | (id: number) => void | - | useToast(): dismiss a toast |
| title | ReactNode | - | Toast option: heading |
| description | ReactNode | - | Toast option: secondary text |
| type | "default" | "success" | "error" | "warning" | "info" | "default" | Toast option: accent color |
| duration | number | 4000 | Toast option: auto-dismiss ms (0 = never) |