GaugePro
A value against a known range as a ring that fills once, springs to new values while the percent rolls, and changes tone and caption exactly at its thresholds.
oxyn add gaugeThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- A value against a known range as a 270° ring.
- The ring fills once on mount without overshoot, then springs to new values while the number rolls digit by digit.
- Threshold bands (Band { from, tone, label }) set the tone and caption: the highest band reached wins, exactly as the value crosses it.
- Without bands the tone applies. raw shows the value with a unit instead of the percent of the range; detail adds a second caption.
When not to use
- A launch countdown with digits that roll per unit, a compact one-line variant, hours absorbing days when days are hidden, and a live state with a pulsing dot at zero: use Countdown instead.
- A total that moves clearly: use Animated counter instead.
- A collapsible JSON tree with search, paging for long arrays, copy value or path, the current path under the tree and full keyboard moves: use JSON viewer instead.
Installation
Gauge is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add gaugeUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Bands
Bands set the tone and caption as the value crosses them.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Critical
Past the danger band.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Plain
No bands: one tone.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
Gauge
| Prop | Type | Default | Description |
|---|---|---|---|
valuerequired | f64 | — | Value. |
min | f64 | Default::default() | Lower bound. |
max | f64 | 100.0 | Upper bound. |
label | String | Default::default() | Label under the number. |
detail | Option<String> | Default::default() | Second caption line. |
tone | String | "accent" | Tone when no band applies. |
bands | Vec<Band> | Default::default() | Threshold bands. |
size | f32 | 140.0 | Diameter in px. |
raw | bool | Default::default() | Show the raw value instead of the percent of the range. |
unit | String | Default::default() | Unit after a raw value. |
Read from the Rust signature and doc comments.
Accessibility
- role=meter with min, max, now and a valuetext that includes the band.
- Reduced motion lands on the value at once.
From the spec
- role=meter with min, max, now and a valuetext including the band.
Motion & interaction
Timing
- First fill 1 s ease-out; changes 700 ms spring; digits roll 260 ms.
- Reduced motion lands on the value at once.
Responsive behaviour
- The size prop sets the diameter.
Edge cases (spec)
sizesets the diameter (140).
Notes for AI
- Import
Gaugefromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
GaugeElinoxyn_gpui. - Props to set first:
value. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.