Bonusway design system

Feedback

Toast

A transient confirmation that something happened — copied, saved, removed. Fires from an event via the useToast hook, not from render.

import { Toast, ToastProvider } from '@/components/ui/Toast';

Source: src/components/ui/Toast.tsx

Examples

The four variants

Same contrast treatment as Alert. Click any of these.

interactive

Props

<Toast> props

PropTypeDefaultDescription
variant'success' | 'error' | 'warning' | 'info''info'—
onDismiss() => void——
childrenrequiredReactNode——

<ToastProvider> props

PropTypeDefaultDescription
childrenrequiredReactNode——

Accessibility

  • Rendered in a live region, so it is announced without stealing focus.
  • Because it vanishes, it must never be the only place a message appears.

Usage

Do

  • Use it for the outcome of an action the user just took.
  • Keep it to one short sentence — it disappears, so nothing important can live only here.

Don’t

  • Don’t report a validation error in a toast. The error belongs next to the field, where it stays.
  • Don’t queue several at once for one action.

Related:Alert

Tämä verkkosivusto käyttää evästeitä

Käytämme evästeitä parantaaksemme käyttökokemustasi sivustollamme ja mukauttaaksemme sinulle tarjoamaamme sisältöä. Tärkeät evästeet ovat välttämättömiä jotta palvelumme toimii oikein. Jos suostut siihen, että keräämme tietoja sinusta käyttämällä välttämättömiä evästeitä ja markkinointievästeitä, valitse "Hyväksy kaikki". Voit aina muuttaa valintaasi evästeasetuksista.

Evästeasetukset