Primitives
Primitive

Toast

Brief notification message that appears temporarily

A toast is a brief, self-dismissing message that confirms an action or reports a result without blocking the page. Call toast() from anywhere to show one. Use it for transient feedback like "Saved" or "Upload failed", not for content the user must act on (use Dialog or Alert Dialog there).

Preview

Installation

Usage

Examples

Types

Use type (or the toast.success, toast.error, and similar shorthands) to set the toast's color and icon.

TypeDescription
defaultA neutral toast with no status color.
successConfirms an action completed.
errorReports a failure.
warningFlags a risk or caution.
infoConveys neutral, non-status information.

Anchored Toast

Use toast.anchored() to pin a toast to a specific element for contextual feedback like a "Copied" confirmation.

With Action

Use the action option to add a button; clicking it dismisses the current toast and can trigger a follow-up.

Deduplicated

Pass a fixed id to collapse repeats; a matching toast updates in place with a pulse instead of stacking a duplicate.

Promise

Use toast.promise() to drive loading, success, and error states from a promise's resolution.

Varying Heights

Toasts measure their own height and adjust the stack when content sizes differ.

Grouped Toasts

Use toast.grouped() to fold related toasts into one summary with an expandable card, for long-running work like deployments or uploads.

Accessibility

Announcement urgency

Use priority to control how a screen reader announces the toast. "low" (the default) announces politely without interrupting the user; reserve "high" for messages that must break through, such as a failed save.

API Reference

The Toast component is built on top of Base UI's Toast. All Base UI props are supported. The documentation below only covers custom props and modified defaults specific to our implementation.

For the complete Base UI API, see the Base UI Toast documentation.

Props

toast()

Programmatically displays toast notifications. Supports object-based and JSX-based call signatures.

Prop

Helper Methods

Type-specific methods for common toast types and programmatic control.

toast.anchored()

Shows toasts anchored to a specific element, useful for contextual feedback like "Copied" confirmations. Inherits all base toast options except type.

Prop

toast.grouped()

Groups multiple related toasts into a single collapsible summary. When only one item exists, it renders as a normal toast. When multiple items share the same groupId, they collapse into a summary with a "Show" button that reveals an expandable card.

Prop

GroupSummaryCounts

The groupSummary function receives a GroupSummaryCounts object with these fields:

  • loadingCount - Items currently in loading state (reflects visible items)
  • completedCount - Total items that have completed (historical, persists after dismiss)
  • totalCount - loadingCount + completedCount
  • successCount - Items completed with type "success" (historical)
  • errorCount - Items completed with type "error" (historical)
  • warningCount - Items completed with type "warning" (historical)
  • infoCount - Items completed with type "info" (historical)

Helper methods:

Behavior:

  • Single item: Renders as a normal toast with close button
  • Multiple items: Collapses into summary with Show/Hide button
  • Loading items: Groups persist until all loading items complete or are dismissed
  • Icon derivation: Shows loading spinner while any item has type: "loading", then success/warning/error based on results

toast.groupedPromise()

Shows a grouped toast that resolves with a promise, handling loading/success/error states automatically. Supports cancellation via AbortSignal.

Prop

All other GroupedToastOptions props (groupId, groupSummary, groupAction, etc.) are also supported.

ToastProvider

Wraps your app to enable stacked toast notifications. Composes Base UI's Toast.Provider, Toast.Portal, and Toast.Viewport.

Prop

AnchoredToastProvider

Wraps your app to enable anchored toasts (positioned relative to elements). Composes Base UI's Toast.Provider, Toast.Portal, and Toast.Viewport.

Prop

Setup

Wrap your app with both providers to enable all toast functionality: