search⌘K

Toast

Last Updated: September 2026

Toasts are short system communications that alert the user to the status or an actions.

Anatomy

link
Dotted grid scale: 8px
  1. 1Icon
  2. 2Content
  3. 3Close

Variants

link

Info

Neutral status. toast.add requires intent, icon, and content.

Success

Confirm a completed action.

Warning

Non-blocking caution after an action.

Danger

Failed action or error feedback.

Promise

toast.promise maps loading / success / error messages automatically.

Usage Guidelines

link

When to use

  • •For ephemeral feedback after a user action (saved, queued, failed).
  • •When the message should not block the page.
  • •For async promise progress with loading → success/error.

When not to use

  • •For persistent page-level status — use Banner or AlertNotification.
  • •When the user must act before continuing — use Modal.
  • •For unread counts — use AlertBadge.
checkDo

Keep toast copy short and outcome-focused.

closeDon't

Don't put long instructions in a toast — use Banner or AlertNotification.

checkDo

Wrap the tree once with ToastProvider; call useToast only inside it.

closeDon't

Don't use toasts for persistent page status — prefer Banner or AlertNotification. Always call useToast only under ToastProvider.

Behaviors

link

Provider + hook

  • •ToastProvider owns the portal viewport (bottom-right) and toast list.
  • •useToast() returns { add, update, close, promise } and must run under ToastProvider.

add options

  • •add requires intent, icon, and content (mapped to description internally).
  • •Optional id lets you update or close a specific toast.

promise helper

  • •promise shows loading (info/loading icon), then success or danger based on settle.
  • •success and error accept a string or a callback receiving the result/error.

Content Guidelines

link

Copy

  • •Prefer under ~60 characters.
  • •Describe the outcome ('Note saved'), not the control ('Click save').
  • •Synthetic healthcare-safe copy only.

Accessibility

link

Text & Labels

  • •content is announced as the toast description.
  • •Each toast includes a close control via IconButton.

ARIA attributes

  • •Toasts live in a dedicated viewport; avoid stacking critical instructions only in toasts.

Keyboard Support

  • •Users can dismiss with the close control; focus returns to the page.

WCAG Compliance Standards

FAQs

link

Why isn't Toast exported for direct rendering?

Render ToastProvider once and drive UI through useToast(). Toast instances are managed internally.

What does add require?

intent, icon, and content. Optional id for later update/close.

How do live examples stay valid?

Define a child component that calls useToast, then wrap it with ToastProvider in the same example.

link