Skip to content
shadcn.io

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.

Framework
UI library

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

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

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.

Can I style description text differently from title?

It already is: AlertTitle uses the regular text color with more weight, and AlertDescription uses the muted color at the regular weight. Pass a className to either part to change it, with theme tokens such as text-foreground.

How should standard alerts with descriptions adapt for mobile?

They need no changes: the alert takes the full width of its container and the description wraps. The demo caps the width with max-w-lg, which narrower screens simply don't reach.