Toast

Brief feedback after an action or asynchronous operation. Sonner is the shared notification library.

Try a notification

Use success for a completed action, error for an operation that failed beyond a specific field, and loading while an operation is in progress.

Usage

Use a toast

Confirm saved changes, copied data, completed exports, and operation failures that affect the whole action.

Validate in the field

For an invalid form value, focus and shake the affected input. Keep corrective guidance available through its accessible description.

Implementation

The shared Toaster is mounted once in the root layout. Call Sonner where the action resolves.

import { toast } from "sonner";

toast.success("Changes saved");
toast.error("Couldn’t save changes");