shadcn.io is not affiliated with official shadcn/ui
Dual Gauge Comparison Stats Block for React
Two open 270-degree dials side by side for a sprint-tracking tool, each with its percent done, with a round chip on the divider that gives the gap between the two teams in points.
Installation
Overview
A dual gauge comparison for React with Base UI. A centred header says how far apart two teams finished the same sprint, "Growth closed 91% of Sprint 24, Platform 72%". Under it, a band that runs from rail to rail and ends the block holds two cells that share one divider. Each cell is an open dial, a 270-degree arc with its gap at the foot, drawn at full weight for the team that finished more and at 55% for the other, with the percent rolling up in the middle, a 0 and a 100 at the arc's ends, and the team's name with its tasks done and still to go underneath. A round chip on the divider gives the gap between the two, "+19 pts", and on a phone the cells stack with the chip sitting on the rule between them. The dials are hand-drawn SVG arcs in your theme's foreground colour, with no chart library and no colour for good or bad. For team and sprint dashboards, release health pages and any "us against them" figure.
FAQ
How do I change the teams and the numbers?
Edit SPRINT and TEAMS at the top of the file: each team is a name, the tasks it done and the tasks it planned in total. The percent, the arc, the tasks still to go, the gap on the chip and the headline are all computed from those two numbers, and the team with the higher percent gets the full-weight dial. Two teams is what the layout is drawn for; the grid is two columns from md.
How are the dials drawn?
Each dial is two SVG paths in a 200 by 200 box: a grey track that runs from 135 to 405 degrees, and the value arc on top of it, which starts at the same point and stops at the percent. The arcs are computed from the angle with a small arcPath helper when the module loads, so there are no magic path strings. The value arc is drawn on with a stroke-dash transition when the page loads; with reduced motion it simply appears. The middle and the 0 and 100 labels are HTML on top of the SVG, so they stay crisp and selectable.
What does the chip between the dials do?
It states the gap in percentage points, computed from the two percents, and sits on the divider so the eye goes from one dial to the other through it. It is decorative: the header already says the same thing in words, so assistive technology skips the chip and each dial is read as an image whose name gives the team, its tasks done and the percent. On a phone the cells stack and the chip moves to the rule between them.
Why aren't the dials green and red?
Whether 72% is bad depends on the sprint, and a colour would decide that for the reader. The block uses weight instead: the dial that finished more is at full strength and the other at 55%, solid mixes of the text colour, so the pair reads in both themes and in greyscale. If one team breaches a target you care about, add a status icon beside its name rather than tinting the arc.
Does it work in right-to-left languages?
Yes. Each dial sits in a left-to-right box, because an arc fills clockwise from the lower start in every language, and the percents and counts sit in bdi elements, so they never reorder. The text around the dials, the header and the captions, follows the page direction, and the chip stays centred on the divider.
How does it fit on a phone?
Below md the two cells stack, the second one starting under a rule with a + mark on each rail, and the chip sits on that rule. Each dial is 224 pixels wide on a phone and 256 from sm, so the first dial and its percent are on the first screen, and nothing scrolls sideways at 320 pixels.
Related
- Pro
Tick Dial Hero Metric Stats
Hero metricA hero figure for a crowdfunding page as a dial of sixty radial ticks, the share raised drawn at full weight, with the amount raised in the middle and the percent funded beside it.
- Pro
Concentric Rings Stats
Goals and progressA music-practice tracker's three daily goals as nested rings with rounded ends, each running clockwise as far as the minutes played, with a goal that is met drawn as a ring that has closed, and three hairline cells that read minutes against goal.
- Pro
Half Donut Card Stats
Parts of a wholeA team's weekly capacity as a 180-degree arc of four segments with the total in its foot and a four-cell legend band, with no needle: one whole, shared out.
- Pro
Goal Ring Tiles Stats
Goals and progressFour goal tiles for an OKR tool, each a thin ring with the part done drawn solid, the part today's pace will add drawn lighter after it and a tick for the target, with the projected finish in words.
- Pro
Gauge Cluster Features
Metrics and chartsThree semicircle gauges in one framed band, driven by a single "Simulate load" slider: CPU, memory and queue wait, each with a needle, an arc, a reading and a state.
- Pro
Benchmark Scale Stats
DistributionsFive support metrics, each on a scale line with three markers (your team as a solid dot, the industry average as a ring, the top 10% as a tick), a verdict with a glyph and words, and the three values as text.