Toast
Notifications from anywhere via useToast. They stack (max four), slide in softly, auto-dismiss after ~4s and live in an aria-live region.
import { ToastProvider, useToast } from "marclayui";Setup
Wrap your app once — the toasts render in a fixed stack and this page already has the provider mounted, so try the buttons below.
Variants
| Prop | Type | Default | Description |
|---|---|---|---|
placement | "top-right" | "top-center" | "bottom-right" | "bottom-left" | "bottom-right" | Where the stack renders (fixed). |
toast(options) | (o: ToastOptions) => void | — | Push a toast; options are variant, title, message, duration. |
duration | number | 4200 | Auto-dismiss delay in ms; 0 sticks until closed. |