shadcn.io is not affiliated with official shadcn/ui
Success Alert Banner Block for React
A success notice for a release pipeline on a faint tinted band: a check icon, a heading, one line, a link to the deployment and 18 slim segments, one per passed check, that fill in once.
Installation
Overview
A success banner for React with Base UI, to confirm that something finished and everything checked out. A faint tinted band runs between the page's solid rails, under the top rule. At the start, a check icon in the success colour, a heading ("Deployed to production in 42 seconds"), one line saying the release is live and that 18 of 18 checks passed, and an underlined link to the deployment. At the end, 18 slim segments, one per check, fill in from the start once on load, in a short stagger; on a phone they wrap into two rows of nine. Only the icon carries the status colour; the band, the text and the segments follow your theme. It's built from Guides and your theme's tokens, and it has no state, so it renders on the server. For deployments, imports, backups and any run whose result is a count of checks.
FAQ
How do I change what it reports?
Edit DEPLOY at the top of the file: the heading, the line, the link and checks, the number of checks. The segments are drawn from that number (SEGMENTS), and the sentence prints it, so the two cannot disagree. The phone layout is two rows of nine: if you change the number of checks, change grid-cols-9 to half of it.
Is the segment bar read out?
No. It is decoration: the sentence says "18 of 18 checks passed", so a screen reader hears the same fact in words and the bar is hidden from it. The count sits in a bdi element so a right-to-left layout keeps it whole, and the bar keeps one direction (dir="ltr") so it fills the same way on every page.
How would it show a failed check?
Fill only the passed segments with bg-foreground and leave the rest bg-border, then change the sentence to "17 of 18 checks passed". Keep the failure's meaning in words, and move to the warning or error alert when the run did not succeed, rather than recolouring this one.
What moves, and what happens with reduced motion?
The band fades in once when the page loads and the segments grow and fade in one after another, a short CSS transition each with a 35 ms step. With reduced motion turned on nothing animates and every segment is simply there.
Why is it a labelled section and not a live region?
The notice is part of the page from the first paint, so it is a section named by its heading, which screen readers list with the page's regions. A live region only announces content that changes after load. If you show it after a deploy finishes, render an empty role="status" element from the start and fill it when the result arrives.
Related
- Pro
Stacked Alert Banner
AlertsFour notices from an invoicing back office in one framed list: an error, a warning, an info and a success, each with its own close button, a live count and a Dismiss all.
- Pro
Info Alert Banner
AlertsAn in-page info callout for an invoicing app: a card in card with an info icon, a heading, two sentences about a change coming next month, a Shine Button link and a dismiss button that folds the block away.
- Pro
Warning Alert Banner
AlertsAn expiry callout for a certificate manager: a framed panel with a warning icon and a Shine Button that renews in place, turning the alert into a success, plus a ghost button that folds it away.
- Pro
Icon Left Alert Banner
AlertsAn icon-led callout for a CI service: a muted icon chip at the start, a heading, one sentence and a link, with a pair of bars comparing last week's build time with this week's.
- Pro
Error Alert Banner
AlertsA failed-deploy callout for a deploy platform: a band with a failure icon, a heading naming the commit, a Shine Button to retry, and a framed excerpt that quotes the failing lines with the bad one marked.
- 72%Pro
An export job in one row for an invoicing tool: a thin progress bar with its percentage and seconds left that fills once and turns into a Download button, with Cancel and Run again.