Skip to content
Playground

Toast

An imperative banner-style notification system built on Base UI Toast.

An imperative banner-style notification system built on Base UI Toast. Surfaces, typography, icons, and controls match the static Alert component while Base UI owns queueing, stacking, and live-region behavior.

Backed by Base UI Toast for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.

TSX
import { Toast, toast } from "@zentara-co/zenos-ui";

Render one Toast.Toaster near the application root. Calls to toast can then originate from any client component.

Use semantic variants for the meaning of the result. Status variants share the same banner surfaces and filled leading icons as Alert. Neutral default and none omit the default icon unless you pass icon. error receives high announcement priority automatically. Title and description use body medium and body regular at the body-m scale with ellipsis truncation.

Use one short action for an immediate recovery path such as Undo. The action should not duplicate the dismiss control or open an unrelated workflow.

Project is active.

Pass icon to override the variant default leading icon. actionBottom adds supporting React content beneath the description. inline places title and description on one row. showIcon and showCloseButton hide the leading icon or dismiss control when another clear treatment exists; avoid removing both automatic dismissal and the close control. Action and close controls inherit the toast variant color.

The provider displays up to three toasts by default and marks older entries as limited when that threshold is exceeded. Configure limit and the default timeout on Toast.Toaster. Pass timeout: 0 to a particular toast when it must persist, and retain a visible close action.

Set position on Toast.Toaster to choose the default placement. Available values are top-left, top-center, top-right, bottom-left, bottom-center, and bottom-right (the default). Left and right refer to physical screen edges, including in RTL layouts. Each position adapts to narrow viewports.

Pass position to toast() or any variant helper to override placement for that notification. Each position stacks independently; the provider’s limit remains shared across all positions. Toast.Viewport also accepts position when composing it with Toast.Provider.

TSX
<Toast.Toaster position="top-center" />; toast.success({ title: "Project saved" }); // Uses top-center.toast.error({ title: "Upload failed", position: "bottom-right" });

Install only one toaster for a manager; multiple global toasters render the same notification more than once.

Variants

defaultinfosuccesswarningerrornone
Toast.Toaster
Toast.Provider
Toast.Viewport
Toast.Root
Toast.Content
Toast.Title
Toast.Description
Toast.Action
Toast.Close

API

PropTypeDefaultDescription
toast(options) (options: ToastOptions) => string — Queues a notification.
toast.info / success / warning / error (options: ToastOptions) => string — Queues a notification with a semantic variant.
toast.dismiss (id?: string) => void — Dismisses one notification or all active notifications.
variant ToastVariant default Semantic visual tone.
actionLabel / action ReactNode / () => void — Optional toast action.
showCloseButton boolean true Shows the dismiss control.
icon ReactNode — Custom leading icon; overrides the variant default on status toasts.
showIcon boolean true Shows the leading icon when a custom or variant default icon exists.
inline boolean false Places title and description on one row.
icon / actionBottom ReactNode — Custom leading icon and supporting content.
timeout / priority number / "low" | "high" — Per-toast duration and announcement priority.
Toaster.timeout / limit number / number 5000 / 3 Default auto-dismiss duration and visible limit shared across all positions.
Toaster.position / Viewport.position ToastPosition bottom-right Default placement: top-left, top-center, top-right, bottom-left, bottom-center, or bottom-right.
toast({ position }) ToastPosition — Overrides the default placement for one notification, including variant helpers.
native props React.Base UI Toast props — Forwards native attributes, events, aria-*, data-*, className, style, and ref.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

The default toast portal sits above Zenos dialog, alert-dialog, and sheet layers, including their backdrops. Keep the application toaster mounted near the root so modal actions can show notifications through the same manager. A custom container remains subject to its ancestors’ stacking contexts.

Base UI announces toast content through its live-region behavior without moving focus. Use high priority only for errors requiring timely attention; routine success and information messages should not interrupt current speech. Keep titles concise, make actions keyboard accessible, and preserve a dismiss route for persistent notifications. A toast must supplement—not replace—visible state changes or inline form errors needed to complete a task.