CSS Semicircle Gauge
A half-circle gauge drawn with a conic gradient and a mask, showing a score from 0 to 100.
<div class="gauge-semi" style="--value: 68" role="meter" aria-label="Score" aria-valuenow="68" aria-valuemin="0" aria-valuemax="100">68</div>
.gauge-semi {
--value: 0;
position: relative;
display: grid;
place-items: end center;
width: 200px;
aspect-ratio: 2 / 1;
overflow: hidden;
color: #78350f;
font: 800 40px/1 system-ui, sans-serif;
}
/* A full ring, with its bottom half hidden by overflow */
.gauge-semi::before {
content: "";
position: absolute;
inset: 0 0 -100%;
border-radius: 50%;
background: conic-gradient(
from -90deg,
#f59e0b calc(var(--value) * 1.8deg),
#fde68a 0 180deg,
#0000 0
);
-webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 22px), #000 calc(100% - 21px));
mask: radial-gradient(farthest-side, #0000 calc(100% - 22px), #000 calc(100% - 21px));
}
About this CSS Semicircle Gauge
This CSS Semicircle Gauge is 27 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses radial gradients, conic gradients, masks and CSS Grid. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
Change these custom properties to restyle the semicircle gauge without touching the rest of the CSS:
| Property | Default |
|---|---|
--value | 0 |
How to use this semicircle gauge
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.gauge-semiclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.