Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Paired Bars Queue Metrics Block for React

Five message queues as rows of paired bars, the release before as an outline and the current release solid, with a three-way switch between throughput, lag and dead letters, and a header that counts the lagging queues.

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

A queue metrics block for React with Base UI. A start-aligned header counts the queues that are lagging from the data ("1 of 5 queues lagging after v3.14") and carries a three-way switch at its end: Throughput, Lag and Dead letters. Under it, one band ruled from rail to rail ends the block: a legend (the release before is an outline, the current release is solid) and a row per queue with its name, what it carries, a pair of bars on a shared scale for the chosen measure, the current value rolling in place and a signed change on the release before. Switching redraws every bar with a CSS transition and announces the measure; the values are always in text, so the bars add shape and nothing else. The one lagging queue takes a warning dot and says "lagging" in words. It's built from Segment Group, Sliding Number, Status and Guides, with your theme's tokens for every colour.

FAQ

How do I change the queues, the measures or the limit?

Edit QUEUES (each has an id, a one-line note and its [before, now] readings for every measure, in the order of METRICS), METRICS (label, unit and the step the scale rounds up to) and LAG_LIMIT in seconds. Each measure's scale is its largest reading rounded up to the step, the bars are shares of it, and the count in the title is the number of queues whose lag now is above the limit, so nothing is kept in step by hand. The numbers are example data.

Why does a queue with no dead letters show no bar?

A bar of zero length would still draw its outline as a sliver, which reads as a small value. A zero is no bar, and the number beside it says 0 and the change says what it was.

How does it read without the bars?

Each row is a list item with the queue's name as a heading, its note, the current value and the signed change with a hidden sentence ("on v3.13, from 640 msg/s"). The bars are decoration and hidden from assistive technology. The switch is a radio group; a polite status line says which measure is showing.

What changes on a phone?

The switch moves under the header and each queue's bars go under its name, full width, with the value still at the end of the name line. The legend wraps and the measure's name drops out. Nothing scrolls sideways at 320 pixels.

What moves, and what happens with reduced motion?

The band fades up once on load. Switching measure slides the bars to their new widths and rolls the changed digits. With reduced motion the bars and the numbers change in place.

Does it work in a right-to-left layout?

Yes. Bars are a measurement, so they keep a left-to-right direction; queue ids, units and signed changes are isolated so a minus or a plus stays beside its number, and the rows follow the page's direction.

  • Pro

    A single bar that slices a 250 ms request budget by hop (edge, auth, database, render), a switch between two releases that re-slices it, and a four-cell band with each hop's milliseconds and its change.

  • Pro

    Three load test runs on one 0 to 800 ms ruler: a line from p50 to p99 with marks at p50, p95 and p99 and a shared SLO line, beside each run's requests per second, error rate and a Pass or Fail badge.

  • Pro

    A health board for a hosting product: four service lanes of thirty daily cells, with a row of release pins above them that open a card of what shipped, and the month's uptime at the end of each lane.

  • Pro

    Two bars per month, this year solid and last year lighter, with a Chart and Table switch that swaps the drawing for a real table of the same numbers in the same box.

  • Pro

    Status Ops Board Features

    Metrics and charts

    An error-budget board for an SLO monitor: five services in bands with a budget bar, a 24-point burn sparkline and a status each, a 1h, 6h, 24h and 30d toggle, and a summary counted from the rows.

  • Pro

    Tabbed Window Uptime History

    Incidents and uptime

    A tabbed window of ninety-day uptime for an uptime monitor: one tab per service, a large uptime figure that rolls to the new service, a strip of ninety daily bars and a three-row table of incidents.