Skip to content
SENVENLI UI

Toast

Brief messages about what just happened, with one optional action; call toast() anywhere under the provider.
Say what just happened
import { Toaster } from "@senvenli/react/overlay";

Examples

Tones

Success, information and danger. A danger toast stays until it is dismissed.

With an action

One link at most: undo a reversible step, or view the result.

Kept until dismissed

A timeout of 0 keeps a toast until it is dismissed; its key dismisses it from code.

Following a promise

`toast.promise`: a spinner while it runs, then the success or the error in place.

Guidelines

When to use it

  • Confirming an action that finished: saved, sent, deleted (with Undo).

Use something else when

  • The message must stay until resolved. Banner

Do and avoid

  • Write in the past tense: "Order confirmed".

Accessibility

Built in

  • Announced politely; danger toasts stay until dismissed.
  • The provider mounts the toast region once.

API reference