Gauge
<zyna-gauge>
Segmented half-gauge for a single scalar reading. Define colour zones with band labels; a dot marker sits on the arc at the value's position, and zones past the marker dim so the eye reads "up-to-here" without a needle.
Demo
Sentiment meter
<zyna-gauge value="55" min="0" max="100" start-label="Low" end-label="High" zones='[ {"from":0,"to":20,"color":"#8b1a1f","label":"Bad"}, {"from":20,"to":40,"color":"#e74c3c","label":"Poor"}, {"from":40,"to":60,"color":"#f1c40f","label":"Neutral"}, {"from":60,"to":80,"color":"#2ecc71","label":"Good"}, {"from":80,"to":100,"color":"#11864f","label":"Great"} ]' ></zyna-gauge>
Usage Tips
- Define zones in ascending order with matching
from/tovalues so adjacent segments meet cleanly. - Omit
labelto have the active zone's band label appear under the number — it changes as the value moves between zones. - Use
label-format=".1%"withmin="0" max="1"for percentage readings. - Gauges work best for single KPIs (CPU, disk, sentiment, NPS). For comparison across entities, reach for a bar or lollipop.
- Don't stack more than three or four gauges side-by-side in a dashboard — the eye stops reading each one.