- Add the registry
- Add gauge
Usage
A gauge is a Meter drawn as an arc, for a measurement within a range that reads at a glance, such as on a dashboard. Its children sit in the middle of the arc.
Composition
Examples
Arcs
startAngle and endAngle set where the arc begins and ends, in degrees clockwise from the top.
The gauge is only as big as its arc, so a semicircle takes half the height of a circle, and its
children sit toward the open side, at the bottom of a semicircle over the top.
Formatted value
GaugeValue shows a percentage by default. Pass format to format the value itself with
Intl.NumberFormat, or a function as the children of GaugeValue to format it yourself. Set
max when the range isn't 0 to 100.
Colors
Recolor the indicator by targeting its data-slot from the root.
Thresholds
Choose the color from the value to warn as it climbs. The arc eases to each new value, unless the reader prefers reduced motion.
Sizes
size sets the diameter and thickness the width of the arc, both in pixels, and a thickness of
half the size or more fills the gauge in like a pie. Size the text to fit, and leave out the label
on a small gauge, naming it with aria-label instead.
Compact
Without children, a small gauge sits in a line of text, as in a list of resources.
- postgres-primary82%
- redis-cache37%
- analytics-replica12%
Props
The tables leave out className, style and render. Parts built on Base UI take them as its styling and composition guides describe.