Skip to main content
Urbicon UI
source

Toast

Non-blocking notifications triggered via a global store. Supports intents, auto-dismiss, progress bars, and custom placements.

5000
Loading...
Loading syntax highlighting...

01 Examples

All Intents

Each intent maps to a semantic icon and border color for instant recognition.
Loading...
Loading syntax highlighting...

Title Only

Compact toasts without a description for brief confirmations.
Loading...
Loading syntax highlighting...

Progress Bar

An animated bar counts down the remaining duration. Compare with and without to see the difference.
Loading...
Loading syntax highlighting...

Custom Duration

Set duration in milliseconds. Use 0 for persistent toasts that require manual dismissal.
Loading...
Loading syntax highlighting...

Non-Dismissible

Remove the close button for toasts that should only auto-dismiss.
Loading...
Loading syntax highlighting...

Programmatic Dismiss & Clear

toaster.add() returns a toast ID for targeted dismissal. toaster.clear() removes everything.
Loading...
Loading syntax highlighting...

Document Editor

A real-world pattern: contextual toasts triggered by app actions.

Document Editor

Start typing your document…

Loading...
Loading syntax highlighting...

02 Customization

slotClasses Override

Override individual toast slots for a branded look without going fully unstyled.
Loading...
Loading syntax highlighting...

Toaster Store API

All methods on the toaster singleton.
Loading...
Loading syntax highlighting...

03 Accessibility

Live Region

The Toaster container uses aria-live="polite" with aria-relevant="additions removals". Screen readers announce new toasts without interrupting the current task.

Alert Role

Each individual toast is rendered with role="alert", ensuring assistive technologies surface the notification promptly.

Keyboard

Dismiss buttons are focusable via Tab and activate with Enter / Space. The dismiss button has an aria-label="Dismiss".

Focus Management

Toasts use pointer-events-none on the container so they never block interaction with the underlying page. Only the dismiss button within each toast captures pointer events.

Reduced Motion

Fly transitions use the system's duration tokens. The progress bar animation uses a linear timing function that remains functional under reduced motion preferences.

04 API Reference

8 props
8 props

No matching properties

No matching properties

05 Types

Store & Type Definitions

Types for the toaster store API. ToastInput defines what you pass to toaster.add(), the shorthand methods accept ToastShorthandOpts.

8 types

No data available

No data available

06 Installation

Import

Loading...
Loading syntax highlighting...