Skip to content

Sonner ​

Overview ​

A toast notification container built on vue-sonner, providing styled toast popups with registry-backed icons for success, info, warning, error, loading, and close states.

It reads these icon names from the Sonner registry entry: check for success, info, triangleExclamation for warning, close for error and for the close button, and loading.

Theme entry: Sonner

Props ​

NameTypeRequiredDefaultDescription
iconOverrideObjectnullA partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants.
themeOverrideObjectnullA partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants.
classimport('vue').HTMLAttributes['class']undefinedAdditional CSS classes to apply to the root element.
positionstringundefinedThe position of the toaster on screen.
closeButtonbooleantrueWhether toasts should be shown with a close button. Defaults to true: without it, drag-to-dismiss is the only way to close a toast early, and that gesture has no visual affordance.
richColorsbooleanundefinedWhether rich colors should be used.
invertbooleanundefinedWhether the newest toast should appear on top.
visibleToastsnumberundefinedMaximum number of toasts shown at once.
durationnumberundefinedDuration in ms before a toast auto-dismisses.
gapnumberundefinedGap between toasts in pixels.
asstring|objectundefinedThe element or component to render as.

Source ​

client/lib/feedback/toast/Sonner.vue