shadcn.io is not affiliated with official shadcn/ui
Alert examples · Info
Info with Title, Description and Action Alert for React
An info alert with a title, a description, and Learn More and Dismiss buttons.
When information needs both context and a next step, combine them. This React alert stacks an AlertTitle and an AlertDescription in an Alert with variant="info" and adds Learn More and Dismiss in AlertAction. Use it for beta announcements or rollouts where the reader needs what changed, what it means, and where to read more.
Preview
Installation
FAQ
Which parts does this info alert include?
AlertTitle, AlertDescription, and Learn More plus Dismiss in AlertAction. The root is variant="info" with className="max-w-lg". There is no icon.
Why is Learn More filled while Dismiss is outlined?
The filled default button is the action the alert is inviting; the outline button is the quiet way out. Two filled buttons would compete, and the reader would have to stop and decide which one matters.
What does the description say?
"This feature is currently in beta. Some functionality may be limited." It is the text of AlertDescription, in the muted color. The info tint is on the background and the border.
How are the buttons placed next to a wrapping description?
AlertAction is absolutely positioned at the top right, and the alert adds right padding so the title keeps its room. The description wraps in the grid under the title. Both buttons are size="xs" in one slot with className="flex gap-2".
Related
- Info with Title and Description AlertAn info alert with a title and a
- Info with Title and Action AlertAn info alert with a title and Learn More
- Info with Everything AlertAn info alert with an info icon, a title
- Warning with Title, Description and Action AlertA warning alert with a title, a
- Info with Title AlertAn info alert with only a title, for a
- Error with Everything AlertA destructive alert with an error icon, a