shadcn.io is not affiliated with official shadcn/ui
Sonner examples · Standard
Info Toast Sonner for React
A button that shows an info toast with the info icon.
An info toast shares something useful that isn't a success, a warning or an error. The button calls toast.info, and Toaster adds its info icon. Use it for new versions, tips and neutral updates.
Preview
Installation
FAQ
How does this demo show an info toast?
The button calls toast.info with "New updates are available". That sets the type to info. Toaster draws an InfoIcon with className="size-4" and aria-hidden.
Which options does this call pass?
Only the message. There is no description, action, duration, or custom icon in this file.
How do I add a line under the update message?
Pass description as the second argument to toast.info. It renders under the title. This demo leaves it off.
How do I show the same words with no info icon?
Call toast with the string. A plain call has no type, so Toaster skips the info icon. This file uses toast.info, so the icon is InfoIcon.
Related
- Default Toast SonnerA button that shows a plain toast with
- Success Toast SonnerA button that shows a success toast with
- Warning Toast SonnerA button that shows a warning toast with
- Toast with Action Button SonnerA toast with an Undo action button that
- Standard with Title AlertA neutral alert with only a title, for a
- Loading Toast SonnerA loading toast with a spinner that stays