Skip to content
Alea0.1

Feedback

Toast

A brief message that confirms something happened, with an optional action like Undo.

Ant Design: message, notification

import { ToastProvider, useToast } from '@alea/ui';

Examples

Toasts

show() from anywhere under ToastProvider. Hover or focus pauses the timer.

With an action

Undo is the classic.

Props

ToastProvider props

Shows toasts anywhere below it; put it once near the root.

PropTypeDefaultDescription
placement"bottom-end" | "bottom" | "top-end" | "top"'bottom-end'Where toasts stack: bottom-end (default), bottom, top-end or top.

Accessibility

  • Announced politely (errors assertively); timers pause on hover and focus.
  • Errors stay until closed.

Keyboard

KeyDoes
F6 or TabReaches the notifications region
EnterRuns the action
EscapeCloses the focused toast

Do and don't

Do

  • Confirm actions people can't see the result of.

Don't

  • Don't put the only way to do something in a toast.
Tested with axe, keyboard and screen reader roles