Skip to content
shadcn.io

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.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

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.

How does it fit on a phone?

Below lg the block is one column: the chip and text first, then the bars at the full width of the page column inside a bordered box. Each row keeps its label, bar and value on one line down to 320 pixels, and numbers are kept in reading order in a right-to-left layout.

Does anything move?

Only the one-time fade-up of the whole block on load, which stops under reduced motion. The bars are static: they show a result, not a process.

  • Pro

    An 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

    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.

  • Pro

    A 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.

  • Pro

    A 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

    An 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

    A 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.