Skip to Content
glob.ui home
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 actionBehaviour
Default, success, infoAnnounced politely through a live region (role="status").
Warning, errorAnnounced at once through role="alert".
Hover or focus inside the listPauses the timer. It resumes when the pointer and focus leave.
Close buttonNamed "Close notification". Dismisses the toast.
Action buttonRuns 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.

On this page