shadcn.io is not affiliated with official shadcn/ui
Sonner examples · Position
Bottom Right Position Sonner for React
A button that shows a toast in the bottom-right corner of the screen.
Bottom-right is the usual spot for feedback, and it's where Toaster puts toasts anyway. This toast passes position: "bottom-right" on the call to show the option.
Preview
Installation
FAQ
Where does this toast appear?
The button calls toast("This is a toast", { position: "bottom-right" }). That places this notice at the bottom right. Other toasts keep the position set on Toaster.
How do I put every toast in that spot?
Set position="bottom-right" on Toaster. This demo sets position on the one call, which is how a single notice lands somewhere the others do not.
Does the position change the message?
No. The message is the string "This is a toast". This call passes no description, icon, action, or duration.
What if I leave position off the call?
bottom-right is also what Toaster uses when position is omitted. This call still passes it, so this notice names the corner itself. The allowed values are top-left, top-center, top-right, bottom-left, bottom-center, and bottom-right.
Related
- Bottom Center Position SonnerA button that shows a toast in the bottom
- Bottom Left Position SonnerA button that shows a toast in the
- Top Right Position SonnerA button that shows a toast in the
- Default Toast SonnerA button that shows a plain toast with
- Toast with Description SonnerA toast with a title and a second line of
- Top Center Position SonnerA button that shows a toast in the top