Skip to content
esc

Toast

Feedbackshadcn/ui

Toast on Radix Toast. A short black message after an action finishes: 'Payment sent', 'Link copied'. It hides on its own after 5 seconds and can carry one action like 'Undo'.

When to use

  • Confirm an action the user just took, in past tense: 'Card frozen'.
  • Offer Undo instead of a confirmation dialog for reversible actions.
  • Don't use it for errors the user must fix; use Banner or the field error.
  • Don't show more than one at a time.

Accessibility

Role
status (polite live region)
Keyboard
F8 moves focus to the toasts. Esc dismisses. Swipe down dismisses on touch.
Notes
Hovering or focusing pauses the timer.

Props

  • open / onOpenChange

    boolean / (open: boolean) => void

    Show it by setting open; it calls onOpenChange(false) when it hides.

  • duration= 5000

    number

    Milliseconds before it hides; on ToastProvider for all, on Toast for one.

  • variant= 'default'

    'default' | 'success' | 'destructive'

    Meaning.

Prompt for your agent

Use the UnbuiltUI Toast. Call unbuilt_get_component("Toast") first and follow its spec: variants, states, usage rules and accessibility.

unbuilt_get_component returns

3 variants1 state3 props4 usage rules4 a11y notes7 tokens1 example

Add it with shadcn

$npx shadcn add https://unbuiltui.com/r/toast.json

Tokens · 7

bg.inversefg.inverseaccent.subtlesuccess.defaultdanger.defaultradius.mdshadow.raised