Toggle Sidebar B
header.lightDarkMode D

Sonner

Toast notification system. Drop Toaster once at the app root and call toast() from anywhere to show a transient message.

When to use Sonner vs Notifications

Sonner is the transient toast (success, error, info — auto-dismiss). Notifications is the persistent inbox list with unread badge.

Default

Trigger a toast from a Button click.

Variants

Success, error, info, warning.

API Reference

Props, events, and slots for each sub-component.

Toaster

Props

PropTypeDefaultDescription
position"top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center""bottom-right"Anchor for the stack.
richColorsbooleanfalseUse coloured variants instead of plain.
expandbooleanfalseExpand stack on hover instead of overlapping.
progressBarbooleantrueShow a full-size auto-dismiss progress fill behind each toast. Pauses on hover; follows the global duration; disabled when expand is on.

Slots

SlotDescription
info-iconOverride the icon used for info toasts.
success-iconOverride the icon used for success toasts.
warning-iconOverride the icon used for warning toasts.
error-iconOverride the icon used for error toasts.

toast() (function)

Props

PropTypeDefaultDescription
messagestringFirst argument. The body of the toast.
options{ description?, action?, duration?, ... }Second argument with extra config.