For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt, and this page is available as Markdown at https://wallarm.github.io/design-system/patterns/feedback-toasts.md.

Feedback toasts

Components: Toaster, ToastActions, Button, Alert, Banner, Dialog, FieldError

A toast reports the result of the user's last action, then leaves on its own.

When to use

NeedUseNot
Confirm a finished mutation ("User deleted")Toast, type: 'default'Alert in the page
Show progress of a request that takes secondsToast, type: 'loading', then updateA spinner in a blocking Dialog
Report an async result (test sent, sync done)Toast, type: 'success' or 'error'type: 'default'
Offer one next step after createToast with actionsA second dialog
Ask the user to decideDialogToast with two action buttons
Show a result inside a form (connection test)Alert in the formToast
Show standing account or system stateBannerToast with a long duration
Show a field validation errorFieldError under the fieldToast

If the message is the only place the user learns something important, do not use a toast. It disappears.

Rules

Type and layout

  • If the user's own mutation finished, use type: 'default' (no icon). A delete confirmed in a Dialog is a finished mutation.
  • Otherwise use 'success', 'error', 'warning' (finished with a caveat) or 'info' (neutral notice).
  • Exception: save toasts on a settings page use type: 'success'. See Settings page.
  • Always set type. Without it the toast renders as 'info' with a blue icon.
  • A description always switches to the extended layout (title over description, 10000 ms), even with variant: 'simple'. Without it the toast is one 48px row, 5000 ms.
  • icon replaces the type icon and takes the type color unless it sets its own text-* class.

Placement and spacing

  • Toaster owns position (bottom center), 24px padding, 12px gaps and layering above every drawer and dialog. Never wrap it in a positioned element.
  • Toast owns its padding and width (256–560px). Never add spacing or width to toast content.
  • Three toasts show at once; hover expands the stack and pauses every timer.
  • Mount one Toaster at the app root. Never mount a second.

Loading and updates

  • If you create a loading toast, always resolve it with update or dismiss. It has no timer and never leaves on its own.
  • If an update adds a description, also pass duration: 10000. The timer is fixed at create.
  • Pass closable: false only to a loading toast the user must not lose.
  • If the user can repeat an action (copy, save), pass a stable id so the toast updates instead of stacking.

Copy

CasePatternExample
Mutation done<Object> <past-tense verb>"User deleted", "Changes saved"
Toggle<Object> enabled / disabled"Policy enabled"
In flight<Verb>ing <object>…"Testing channel…"
Async success<Result> via <provider>"Test delivered via Slack"
Failure<Action> failed — <cause>"Test failed — Slack rejected the request: missing API key"
Create with next stepTitle, one-sentence description, one action"Channel created" + "Go to destination"
  • Use sentence case and name the object, not "Success" or "Done". Never end a title with a period or "!".
  • If the error text is long, put the action in title and the cause in description.
  • Never pre-truncate copy; it clamps with a tooltip.

Behavior

  • Fire one toast per user action. A bulk action fires one toast for the batch ("3 users deleted").
  • If a Dialog confirmed the action, close the dialog first, then fire the toast.
  • Use actions only for a next step after create, one action (two max), each a <Button variant='secondary' size='small' color='neutral-alt'> inside ToastActions.
  • Never make Undo, Confirm or Retry available only in a toast.

Imports

  • Import useToast from @wallarm-org/design-system/Toast. It is not exported from the package root.
  • Outside React, use toaster.create(options) and toaster.update(id, options).

Examples

Confirm a finished mutation with a plain toast. A delete confirmed in a dialog closes the dialog first.

The whole page, with every toast from the one app-root Toaster: create, then send test, copy link and delete from each row's menu. The parts below show each toast on its own.

Offer one next step after create.

The description switches the toast to the extended layout, so it stays 10000 ms.

Turn a loading toast into the result in place.

The loading toast has no timer; the 5000 ms timer starts when update resolves it.

If the failure adds a description, extend the timer in the same update.

The action goes in title and the provider's cause in description.

Reuse an id so repeated clicks update one toast instead of stacking.

If the clipboard is blocked, the same id turns the toast into an error.

States

StateShowExample component
DonePlain toast, leaves after 5000 mstoast.create({ title, type: 'default' })
In flightSpinner, no timer, no progress bartoast.create({ title, type: 'loading' })
ResolvedSame toast changes in place, timer startstoast.update({ id, title, type: 'success' })
FailedSame toast turns into an errortoast.update({ id, title, type: 'error' })
Repeated actionVisible toast updates, no copytoast.create({ id: 'copy-link', … })
Dismissed by codeOne toast removed, or alltoast.dismiss({ id }), toast.dismiss()

What your app owns

  • Toast copy, firing after the request resolves, resolving every loading toast, and stable ids.

These do not exist:

  • Placement or visible-count props. Toaster takes no props.
  • An Undo helper or a promise helper on useToast.
  • Rich text. title and description are strings.
  • className or testId options. The toast root gets data-testid equal to its id, so pass id to locate it in tests.
  • An exported duration constant. Use the literals 5000 and 10000.