Sonner

Sonner – a React toast component with built-in conventions and sensible defaults.

sonner lucide-react

Installation


1

Install the following dependencies:

npx shadcn@latest add https://sbthemes.com/r/sonner.json

Examples


Toast Type

Showcases different types of toast notifications such as success, error, warning, info, and promise-based toasts. Use these to provide instant feedback to users based on actions or system events.

Toast Position

Demonstrates how toast notifications can appear in various screen positions like top-center, bottom-right, or top-left. Useful for aligning toast placement with your app’s layout or design preferences.


API Reference

Toaster

PropTypeDefault
positiontop-left,top-center,top-right,bottom-left,bottom-center,bottom-right-
closeButtonbooleanfalse
durationnumber4000
visibleToastsnumber3
toastOptionsToastOptions-
iconsSuccess,Error,Warning,Info,Loading-