Gauge Meter CSS
A half-circle gauge made of plain CSS borders: the arc fills up to the value written in the HTML, in a single colour, and still works with JavaScript turned off.
Updated
This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Data has 28 effects, including 1 free. Explore the category →
3 usage examples



How it works
Three elements inside a .gmcs-gauge box: a track, an arc, a text. Track and arc are two hollow discs drawn with border and border-radius: 50%. The box, twice as wide as it is tall, clips whatever sticks out: only the upper half is seen.
The arc is coloured on two borders only, top and left: that makes half a ring. Rotated by −135° it is fully hidden below the box. The value goes in the gauge's style attribute, --gmcs-value: 70, and every point turns the arc by 1.8°: at 50 it covers the left half, at 100 the whole half-circle.
The fill is a 1.5 s CSS animation starting from the hidden position. It plays once per display: inside a tab hidden with hidden or display: none, the gauge fills again each time the tab comes back. The few lines of script provided compute nothing: they keep the animation paused until half of the gauge is on screen.
The text in the middle is yours: “70%”, “Bold”, “216 t”. Its size follows the diameter (16% of --gmcs-size). Nothing ties it to the value: when you change --gmcs-value, change it too, along with aria-valuenow.
Accessibility
- Role and name: the gauge is a
role="meter"; Chromium exposes it as “Level: 70%” (the name comes fromaria-label, to be replaced). If the centre shows a word instead of a number, addaria-valuetextwith that word. - Two values to keep in step: the arc reads
--gmcs-value, assistive technology readsaria-valuenow. The code does not check that they agree. - “Less animation” preference: the arc is shown at its final angle straight away.
- Interaction: none. The gauge informs; it cannot be adjusted by mouse, finger or keyboard.
- Colour alone does not say “good” or “bad”: if you turn the arc red above a threshold, keep a word or a figure next to it.
Browser compatibility
Borders, a transform: rotate() computed with calc() and a custom property, @keyframes, clamp() to bound the value; IntersectionObserver for the optional script. Angles recorded in Chromium 149, Firefox 151 and WebKit 26.5: −135° at 0, −45° at 50, +45° at 100; 130 is brought back to +45° and −20 to −135°. The text stays inside the hollow of the ring from 60 to 220 px in diameter.
Before these versions clamp() is ignored: the gauge works, but a value outside 0 to 100 draws a wrong arc. Without JavaScript, or without IntersectionObserver, the fill starts as soon as the page loads, even if the gauge sits further down.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0237-root">
<div class="gmcs-gauge" role="meter" aria-label="Level" aria-valuemin="0" aria-valuemax="100" aria-valuenow="70" style="--gmcs-value: 70">
<div class="gmcs-track"></div>
<div class="gmcs-fill"></div>
<span class="gmcs-text">70%</span>
</div>
</div>
One-time payment, no subscription — the code is yours forever
Customize
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
--gmcs-value in the style of .gmcs-gauge (HTML) |
70 | Level of the arc, 0 to 100. Outside those bounds the value is brought back to 0 or 100. Changed after display, it makes the arc jump with no transition. |
aria-valuenow and the text of .gmcs-text (HTML) |
70 and “70%” | What assistive technology reads and what shows in the middle. You write both, in line with the value. |
--gmcs-color, --gmcs-track (CSS) |
#6366f1, 20% indigo | Tint of the arc and of the track behind it. |
--gmcs-text (CSS) |
#fff | Colour of the central text; darken it on a light page. |
--gmcs-size (CSS) |
150px | Width of the gauge; its height is half of it and the text follows. |
--gmcs-thickness (CSS) |
15px | Thickness of the ring. It does not follow the diameter: allow roughly a tenth of --gmcs-size. |
--gmcs-duration (CSS) |
1.5s | Fill time. |
--gmcs-bg and the root's min-height (CSS) |
#0a0a0f, 300px | Background of the block and height reserved around the gauge. Inside a component: --gmcs-bg: transparent and a .fx-0237-root { min-height: 0 } rule. |
FAQ
--gmcs-value applies at once. Adding a transition on .gmcs-fill is no reliable fix: we tried, the arc glides in WebKit but still jumps in Chromium and Firefox. To show a new value with motion, hide the gauge and show it again: it restarts from zero. If the value changes often, the twin effect is built for that.