Toast

Brief notification message that appears temporarily

Preview

Installation

Usage

Examples

Types

Toast variants for different feedback scenarios: success, error, warning, and info.

Anchored Toast

Toasts can be anchored to a specific element, useful for contextual feedback like "Copied" confirmations.

With Action

Add action buttons to toasts. Clicking the action dismisses the current toast and can trigger follow-up toasts.

Promise

Show loading, success, and error states based on promise resolution.

Varying Heights

Toasts automatically adjust their stacking when content has different heights.

Grouped Toasts

Group multiple related toasts into a single summary toast with an expandable card. Ideal for long-running operations like deployments or file uploads.

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: