Description
Sonner is an opinionated toast component for React, so the notifications come with the look and behaviour its author chose rather than a set of parts to assemble. You render a Toaster once near the root of your app, then call toast from anywhere to show a message. Toasts come in default, description, success, info, warning, error, action and promise types, and you can pass an options object or build a custom toast. The position can be set to one of six places, from top-left to bottom-right, and the swipe direction follows the position. The expand setting controls how many toasts are visible at once. Rich colours give success, error, info and warning toasts their own colours, and a close button is available. There is also a headless option for handling the look yourself. Sonner is installed with npm install sonner, and its source is public on GitHub.…
Highlights
- Toasts for success, error, info, warning and promises
- Six positions, with swipe that follows the position
- Rich colours and an optional close button
- Headless option for your own styling
- Install with npm install sonner
Ratings & Reviews
No ratings yet
Be the first to rate Sonner.
People also visit
Sonner FAQ
What is Sonner?
An opinionated toast component for React. You render a Toaster in your app and call toast to show a message.
How do I install it?
Run npm install sonner, then render the Toaster in the root of your app.
Can I change where toasts appear?
Yes. Set the position prop to one of six places, such as bottom-right or top-center.
Can I style it myself?
Yes. The docs describe a headless option for building your own look.
What are the best Sonner alternatives?
Popular alternatives to Sonner include React Speech Recognition, React Live Island and Styled components. See all Sonner alternatives













