Skip to content

Feedback

Alert

Also calledalert bannernotification bannerinline alert

A visible message that stays in the page to explain a problem, warning, or update, often near the content it concerns.

How people describe it

  • “wide message strip with a warning”
  • “notice that stays above the form”
  • “colored box explaining an error on the page”

Good for

  • Form-level errors
  • Persistent notices about a service

Don’t mix it up with

  • Appears briefly and often disappears automatically; an alert usually stays until resolved or dismissed.

What your library calls it

LIBRARYCALLS IT
shadcn/uiAlert

Accessibility checklist

  • Keep essential messages visible and avoid relying only on color
  • Use assertive alerts only for urgent dynamic messages
  • Do not move focus to a notice unexpectedly

Try it

Heads up

A new version is available. Refresh when you are ready.

Errors use role=alert so screen readers announce them right away.

Prompt

Add an alert with a clear message that stays visible until resolved.

~17 estimated prompt tokensDetailed: ~77 estimated prompt tokens

Rough estimate for prompt text only; actual counts vary by model and context.

<section aria-labelledby="service-notice">
  <h2 id="service-notice">Scheduled maintenance</h2>
  <p>Uploads will be unavailable tonight from 10 to 11 PM. Save your work before then.</p>
</section>
<!-- For urgent dynamically inserted errors, use role="alert"; routine updates use role="status". -->

Used in

Explore website blueprints that use this component.