Variance Meter
Signed deviation read from a centre zero rather than from the left edge — the amber fill runs right of the line for over-plan and a green one runs left for under, with a dashed target marker and a readout that swaps sign as the value crosses on hover.
- lines of CSS
- 86lines of CSS
- dependencies
- 0dependencies
- browser, for years
- Everybrowser, for years
- motion only on interaction
- Hovermotion only on interaction
Vue, Svelte, styled-components and Tailwind exports are part of Pro. HTML, CSS and React are free forever.
.fx-v14-pr-variance-15898 {
display: grid;
gap: 0.45rem;
width: 236px;
padding: 0.7rem 0.75rem 0.75rem;
border-radius: 0.6rem;
background: #101a2e;
border: 1px solid #253049;
font-family: system-ui, sans-serif;
}
.fx-v14-pr-variance-15898 .hd {
display: flex;
align-items: baseline;
justify-content: space-between;
font-size: 0.66rem;
color: #94a3b8;
}
.fx-v14-pr-variance-15898 .vl {
position: relative;
display: block;
width: 56px;
height: 1em;
}
.fx-v14-pr-variance-15898 .vl b {
position: absolute;
right: 0;
top: 0;
font-size: 0.8rem;
font-weight: 700;
font-variant-numeric: tabular-nums;
transition: opacity 0.3s ease;
}
.fx-v14-pr-variance-15898 .vl .a { color: #fbbf24; opacity: 1; }
.fx-v14-pr-variance-15898 .vl .b { color: #34d399; opacity: 0; }
.fx-v14-pr-variance-15898 .tr {
position: relative;
height: 12px;
border-radius: 6px;
background: #1a2540;
box-shadow: inset 0 0 0 1px #263551;
}
.fx-v14-pr-variance-15898 .tr i {
position: absolute;
top: 0;
bottom: 0;
}
.fx-v14-pr-variance-15898 .pos {
left: 50%;
width: 15.5%;
border-radius: 0 6px 6px 0;
background: linear-gradient(90deg, #b45309, #fbbf24);
transition: width 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.fx-v14-pr-variance-15898 .neg {
right: 50%;
width: 0;
border-radius: 6px 0 0 6px;
background: linear-gradient(270deg, #047857, #34d399);
transition: width 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.fx-v14-pr-variance-15898 .zero {
left: 50%;
top: -4px;
bottom: -4px;
width: 1px;
background: #94a3b8;
}
.fx-v14-pr-variance-15898 .tg {
left: 70%;
top: -4px;
bottom: -4px;
width: 0;
border-left: 2px dashed #e2e8f0;
opacity: 0.7;
}
.fx-v14-pr-variance-15898 .sc {
display: flex;
justify-content: space-between;
font-size: 0.55rem;
color: #64748b;
font-variant-numeric: tabular-nums;
}
.fx-v14-pr-variance-15898:hover .pos { width: 0; }
.fx-v14-pr-variance-15898:hover .neg { width: 8.5%; }
.fx-v14-pr-variance-15898:hover .vl .a { opacity: 0; }
.fx-v14-pr-variance-15898:hover .vl .b { opacity: 1; }<div class="fx-v14-pr-variance-15898">
<div class="hd">
<span>Spend vs plan</span>
<span class="vl">
<b class="a">+6.2%</b>
<b class="b">-3.4%</b>
</span>
</div>
<div class="tr">
<i class="neg"></i>
<i class="pos"></i>
<i class="zero"></i>
<i class="tg"></i>
</div>
<div class="sc">
<span>-20%</span>
<span>0</span>
<span>+20%</span>
</div>
</div>What do I do with this?
- Put
variance-meter-15899.cssanywhere your page already loads CSS from — in Next.js that isapp/globals.css, or any stylesheet with a<link>in your HTML. - Then put the class on the element you want it on:
<button class="fx-v14-pr-variance-15898">. The CSS does nothing until a class name in it matches something on the page.
- Link the stylesheet, then paste the markup wherever you need it.
npx hoverlab add variance-meter-15899What's included
- The markup and the stylesheet, in whichever framework you pick
- No runtime dependencies
Works with
- React
- Vue
- Svelte
- Tailwind
- styled-components
- Plain CSS
npx hoverlab add variance-meter-15899
Or over MCP, from your editor's agent — no account needed.
License
Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.
Motion safety
Static estimate, read from the CSS
- Reduced motion
- Brief motion, no guard
Animates briefly or on interaction. Only looping motion gets a guard in this catalog; copy the one from the Insights tab if this ships on a critical path.
- What it animates
- Reflows
Animates
width. The browser re-lays-out the page on every frame; prefertransformif you can. - Flashing (WCAG 2.3.1)
- No flashing found
No repeating change in opacity, colour or brightness large enough to count as a flash.
- Layout shift (CLS)
- May shift layout
Animates
widthon a box in flow, so content beside or after it can move. A category from the CSS, not a measurement for this effect.
Every row is read from the shipped CSS. Only a figure marked measured came from a browser. Customizing the speed changes the timing, so recheck a customized copy. How it is computed
29 more effects in Progress & Meters
All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.
Browse Progress & MetersShipping one commercially
Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
- A commercial licence for everything in the catalog
- Unlimited bundle exports, in Vue, Svelte and Tailwind
- One payment — no subscription, nothing to renew
7 variations of Variance Meter
Finished looks, each one a position in the customizer above. Copy any of them, or open it and keep moving the sliders.