Skip to content
GitHub

Toast

Provides feedback on an action.

Installation

Usage

Deduplication

Toasts with the same id are deduplicated: repeated triggers animate the existing toast.

  • Passing id — deduplicate
  • Not passing id — always create a new toast

Placement

By default, the toaster is placed at the bottom right corner of the screen.

Update the placement option in createToaster() to customize the toaster position.

TypeScriptcomponents/ui/toast.tsx

Max toasts

Any extra toasts will be queued and rendered when a toast has been dismissed.

By default, the toaster displays up to 3 toasts. Update the max option in createToaster() to change the maximum number of visible toasts.

TypeScriptcomponents/ui/toast.tsx

Examples

Variants

Use success, error, warning, and info for the matching icon and accent color.

You can also pass type on toast.create.

Promise

Action

Duration

Control how long a toast stays visible with the duration option.

Use Infinity to keep the toast visible until the user dismisses it.

Closable

Use closable: true to show the close button.

API Reference

Toaster

Toast container. Place once in your app layout (e.g. root layout).

ToastItem

Single toast instance. Used internally by Toaster for each toast.


For a complete list of props, see the Ark UI documentation.