Components
Toast
Short, timed messages. Call `toast()` from anywhere, and mount `<Toaster />` once.
Client componentUses state or handlers, so it starts with "use client".
import { toast, Toaster } from "@glob-ui/toast"Preview
Examples
Action
action adds a button. A sticky toast (duration: Infinity) stays until it is closed.
API
Props are generated from the TypeScript types in the package source.
toast(options)
Prop
Type
Toaster
Prop
Type
Accessibility
| Key or action | Behaviour |
|---|---|
| Default, success, info | Announced politely through a live region (role="status"). |
| Warning, error | Announced at once through role="alert". |
| Hover or focus inside the list | Pauses the timer. It resumes when the pointer and focus leave. |
| Close button | Named "Close notification". Dismisses the toast. |
| Action button | Runs the action, then dismisses the toast unless preventDefault() is called. |
ARIA. The two live regions are always in the page, so screen readers pick up toasts reliably. A toast over an open dialog is still clickable: the Toaster moves into the dialog while one is open.