shadcn.io is not affiliated with official shadcn/ui
Segmented Bar Latency Budget Block for React
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.
Installation
Overview
A latency budget for React with Base UI. A start-aligned header carries a two-way switch (v8.3 and v8.4) at its end. Under it, one inset frame shows the request's total time and a verdict computed from the hops ("Within budget by 21 ms"), then a single bar sliced by hop, Edge, Auth, Database and Render, in four weights of the foreground with 1 px gaps, drawn against a hairline track that stands for the longest the request may run, with a tick at the budget. Under the bar a four-cell band names each hop with its milliseconds, rolled in place, and a signed change against the release before. Switching re-slices the bar with a CSS transition, which is off with reduced motion, and nothing moves on the page. No timer runs: every figure is typed and the total, the margin and the scale are computed. It's built from Segment Group, Sliding Number, Status and Guides.
FAQ
How do I change the budget, the hops or the releases?
Edit BUDGET (milliseconds), HOPS (the hops in the order the request travels, each with a fill) and RELEASES: each has a ms list for its hops and a before list for the release before it. The total, the margin to the budget, the verdict, the scale of the bar and its ticks (up to the next hundred above the longest total) and every signed change are computed from those lists. The numbers are example data.
What does the block show when a release is over budget?
Choose v8.3: its hops add up to 269 ms, so the bar runs past the budget tick, the verdict reads "Over budget by 19 ms" and a destructive dot appears beside it. The words carry the meaning, so the dot is never the only signal, and it is the only warning mark in the block.
How is the bar accessible?
The bar is an image with a text alternative that lists every hop's milliseconds, the total and the budget; the same numbers are in the four-cell band, which is a description list. A polite live region announces the verdict when you switch release. The switch is a radio group: arrow keys move between releases.
What changes on a phone?
The switch moves under the header and the four cells go two by two, with the same hairlines. The bar keeps its proportions, the budget label sits on the start side of its tick, and nothing scrolls sideways at 320 pixels.
Related
- Pro
Paired Bars Queue Metrics
Metrics and chartsFive 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.
- Pro
Percentile Ruler Load Test Results
Metrics and chartsThree 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
Release Band SLA Compliance
Incidents and uptimeA band of three release cells for a managed-service reporting product: uptime, p95 response and first reply with the target beside the actual, a check or a ring for each, and a breach count in each foot.
- Pro
Stacked Percentage Bar Stats
Parts of a wholeOne thick bar of a consultancy's week split into four segments at four weights with labels inside the wide ones, and a band of four legend cells under it; pointing at or focusing a cell brackets its segment.
- Pro
Target Line Bar Chart Stats
Bar and columnFourteen daily bars against a labelled quota line in a framed chart, days at or above the quota solid and days below it outlined, with a two-cell band under it for days met and the average against the quota.
- Pro
Tabbed Window Uptime History
Incidents and uptimeA 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.