shadcn.io is not affiliated with official shadcn/ui
Alert examples · Info
Info with Everything Alert for React
An info alert with an info icon, a title, a description, and Learn More and Dismiss buttons.
This is the full info alert: an InfoIcon from Lucide, a title, a description, and Learn More and Dismiss buttons in an Alert with variant="info". The icon goes first and the alert gives it its own column, colored with the info tint. Use it for prominent announcements, such as a feature launch or a beta program, where the reader should notice, understand, and possibly act.
Preview
Installation
FAQ
What is in this info alert?
InfoIcon first, then AlertTitle, AlertDescription, and Learn More plus Dismiss in AlertAction. The root is variant="info" with className="max-w-lg".
What color is the Info icon?
The theme's --info color, set by variant="info" on the alert. You don't add color or size classes: the alert sizes the icon and colors it for each variant, while the title and description keep the regular text colors.
Why is the icon aria-hidden?
The title already says Info, so the icon is decorative. The demo sets aria-hidden="true" on InfoIcon. The buttons still have visible labels.
How does the icon line up with the title?
Put it first, before AlertTitle: the alert places a direct svg child in its own column, spanning the title and description, and aligns it with the first line of the title.
Related
- Info with Title, Description and Action AlertAn info alert with a title, a
- Info with Title AlertAn info alert with only a title, for a
- Success with Everything AlertA success alert with a check icon, a
- Info with Title and Action AlertAn info alert with a title and Learn More
- Error with Everything AlertA destructive alert with an error icon, a
- Info with Title and Description AlertAn info alert with a title and a