shadcn.io is not affiliated with official shadcn/ui
Alert examples · Standard
Standard with Title and Description Alert for React
A neutral alert with a title and a one-sentence description.
A standard alert gets clearer with a line of context. This React alert is a plain Alert, with no variant, holding an AlertTitle and an AlertDescription. Use it for general updates that need a sentence of explanation, where a colored variant would suggest more urgency than the message has.
Preview
Installation
FAQ
When do standard alerts need descriptions?
When the title tells the reader something happened but not what it means for them. One sentence on what changed or what to do next is usually enough; if the title already says it, leave the description out.
How long should standard alert descriptions be?
One or two sentences. AlertDescription wraps as needed, but a long paragraph turns a notice into an article; link to the details instead.
Should I use standard or info alerts for general announcements?
Info when you want the announcement to stand out with its blue tint, standard when it should sit quietly in the page. If the page already has colored alerts, the default variant keeps this one from competing.
Should standard alerts with descriptions be dismissible?
If the information is only useful once, yes. The Alert has no built-in dismiss: keep its visibility in your own state and put a button in AlertAction that hides it.
Related
- Standard with Title AlertA neutral alert with only a title, for a
- Standard with Title and Action AlertA neutral alert with a title and View
- Info with Title and Description AlertAn info alert with a title and a
- Success with Title and Description AlertA success alert with a title and a
- Error with Title and Description AlertA destructive alert with a title and a
- Standard with Title, Description and Action AlertA neutral alert with a title, a