shadcn.io is not affiliated with official shadcn/ui
Icon Left Alert Banner Block for React
An 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.
Installation
Overview
An icon-led callout for React with Base UI, for good news that comes with a number. A plain muted chip holds the icon at the start, with a heading, one sentence and a link whose arrow mirrors in right-to-left layouts. At the end, two bars pair the median preview build time last week (78 seconds) with now (45 seconds): the second bar's width and the "42% faster" in the heading come from the two numbers, so changing them keeps the block honest. On phones the bars drop under the text. The block draws no lines of its own, only the page's rails and top rule from the Guides spine. It's built from Guides and Progress, with your theme's tokens for every colour. For performance wins, speed-ups, savings and any announcement that is easier to believe with a before and an after.
FAQ
How do I change the two numbers?
Edit BUILDS at the top of the file: each entry is a label and a number of seconds. The heading's percentage is worked out from the slowest and the fastest, and each bar's width is its time as a share of the slowest, rounded, so there is nothing else to keep in step. Two entries is the design; more would need the bars' labels to share a narrower column.
What do screen readers hear for the bars?
The bars are decorative: they sit in aria-hidden boxes. The list around them is named "Median preview build time" and each row is a plain label and value ("Last week", "78 s"), so the numbers are all in the text. The heading and the sentence say the same thing in words.
Why is the icon not coloured?
The chip is a neutral tint on purpose: this is a plain announcement, not an alert about something wrong. If you want a status colour, put text-success or text-info on the icon and keep the text in your theme's foreground colours; never fill the chip with a status colour.
Where does the link go?
See the build report is a plain inline link (href="#"): point it at your report or changelog. It is underlined so it reads as a link without colour, and its arrow mirrors in right-to-left layouts.
Related
- 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
Success Alert Banner
AlertsA 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.
- 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.
- 4,291$38.4kPro
Dual Stat Metric Banner
MetricsA two-figure metric banner for a store dashboard: two cells split by a hairline, each with a label, a big figure, its change on last week, a thin bar to the weekly goal and that share in words.
- Pro
Usage Quota Metric Banner
MetricsAn API-quota banner for an API platform on a tinted band: a bar with 80% and 95% ticks, the warning colour past the alert, and a hatched stretch to 100% for where the pace leads.
- Pro
Top Bar Banner
Top barsA slim announcement strip for a writing app's release: one centred line with the version, the news and an underlined link, and a ghost button that folds the strip away.