Toast

Transient stack feedback — success, error, warn, and info tones.

Preview

Live

Saved

Profile updated.

Failed

Could not send application.

<div class="toast-stack toast-stack--top-end" aria-live="polite">
  <div class="toast toast-success" role="status">
    <span class="toast-icon" aria-hidden="true"></span>
    <div class="toast-body">
      <p class="toast-title">Saved</p>
      <p class="toast-message">Profile updated.</p>
    </div>
    <button type="button" class="toast-close" aria-label="Dismiss">…</button>
  </div>
</div>

Variants

Success

.toast-success.

Saved

Error

.toast-error.

Failed

Warn / Info

.toast-warn and .toast-info.

Needs review

Tip

Placement

Stack corner via .toast-stack--top-end, --top-start, --bottom-start, --bottom-end (default). Uses logical insets + safe-area.

React: placement="top-end" on ToastProvider / ToastStack.

Accessibility

  • Stack uses aria-live="polite"; each toast has role="status".
  • Dismiss controls need an accessible name (dismissLabel).
  • Keep titles short; do not use toasts as the only channel for critical errors that need recovery.

API

HTML classes

Class Description
.toast-stack Fixed stack container (default: bottom + inline-end).
.toast-stack--bottom-end|bottom-start|top-end|top-start Stack corner placement (logical + safe-area).
.toast / .toast-success|error|warn|info Toast + tone.
.toast-icon / .toast-body / .toast-title / .toast-message Content parts.
.toast-close / .toast-close-icon Dismiss control.

React props

From src/core/Toast.tsxToastProvider + useToast, or stateless Toast.

Prop Type Default Description
dismissLabel string Provider / Toast dismiss aria-label (required).
placement ToastPlacement 'bottom-end' Provider / ToastStack corner: bottom-end | bottom-start | top-end | top-start.
defaultDurationMs number 4200 Provider auto-dismiss default.
tone ToastTone 'info' success | error | warn | info.
title / message string Title required; message optional.
push / dismiss fns useToast() API.