Components · Feedback
Imperative toast notifications using the toast object. Render <Toaster /> once in your layout.
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| Toaster position | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center' | 'bottom-right' | — | Where toasts appear on screen. |
| Toaster richColors | boolean | false | — | Enables fully coloured backgrounds for success, error, warning, and info toasts. |
| Toaster closeButton | boolean | false | — | Renders a close button on each toast. |
| toast.success(title, opts?) | string | — | ✓ | Show a success toast with an optional options object. |
| toast.error(title, opts?) | string | — | ✓ | Show an error toast. |
| toast.warning(title, opts?) | string | — | ✓ | Show a warning toast. |
| toast.info(title, opts?) | string | — | ✓ | Show an info toast. |
| toast.custom(title, opts?) | string | — | ✓ | Show a default/custom toast. |
| opts.description | string | — | — | Secondary supporting text below the title. |
| opts.duration | number | 4000 | — | Time in ms before auto-dismiss. Use Infinity to persist. |
| opts.action | { label: string; onClick: () => void } | — | — | Renders an action button inside the toast. |
import { Toast } from '@nexub/react';