Instruments Range
// Range

Range

A min-max-current tolerance band: the safe window is drawn on the rail, the marker is where the value is now, and the colour says whether it sits inside.

<talos-range> answers a different question from <talos-meter>. A meter fills from min to the value: a level. A range asks where the value sits inside an operating window: a temperature between a safe low and high, a pressure within tolerance, a sample inside p5 to p95. The window and the marker are both drawn, so the contract lives on the instrument, not in config.

Default

LIVE
<talos-range value="52" low="40" high="60" setpoint="50"
             label="Coolant" unit="°C" width="300"></talos-range>

The rail spans min to max (default 0 / 100). The shaded band is the window from low to high, the thin line is the marker at value, and the faint tick is the optional setpoint, the target the value is meant to hold. The demo walks value across the rail every second: the marker eases to each reading, while the colour and the readout change at once.

Bands: inside, outside, far outside

PREVIEW
<talos-range value="50" low="40" high="60" crit="15" label="Inside" unit="°C"></talos-range>
<talos-range value="68" low="40" high="60" crit="15" label="Outside" unit="°C"></talos-range>
<talos-range value="82" low="40" high="60" crit="15" label="Far outside" unit="°C"></talos-range>

The band rule is the window, not a single threshold:

ValueBand
inside low to highnominal
outside the window, on the railwarning
crit (or warn) or more beyond a window edgecritical
off the rail (below min, above max)critical

warn and crit here are distances outside the window, not positions on the scale: with high="60" crit="15" a reading of 75 or more is critical. Without them, only leaving the rail escalates to critical. Without low and high there is no window to violate, so the marker reads nominal.

Off the rail

PREVIEW
<talos-range value="112" low="40" high="60" label="Overrun" unit="°C"></talos-range>

A reading past max pins the marker to the rail end, reads critical, and the readout shows the true value. The rail never pretends the value fits.

Inverted: a keep-out zone

PREVIEW
<talos-range value="1550" min="0" max="3000" low="1400" high="1700" invert
             label="Rotor" unit="rpm"></talos-range>

With invert the window is a band to stay out of: a resonance range, a forbidden setting. Inside it reads warning, outside nominal; off the rail is still critical. The accessible summary says “in band” or “clear of band” to match.

No data

PREVIEW
<talos-range low="40" high="60" label="Coolant" unit="°C"></talos-range>

A missing or non-numeric value reads —, parks the marker at min and shows no band colour; the host gets data-state="unknown". The next real value eases up from min. A range with no reading never draws a nominal marker it has no evidence for.

Behaviour

All attributes are reactive. The marker eases toward a new value, or snaps under prefers-reduced-motion or with static; position, colour, number and window are complete in any single frame. A band change fires talos:band. The host is role="meter" with aria-valuenow / min / max and a summary carrying the verdict (“in band”, “out of band”, “critical”).

Attributes

Generated from custom-elements.json in the installed package. Shared attributes (state, format, static…) behave as the instrument contract describes.

AttributeTypeDefaultDescription
value number — current value; missing or non-numeric reads "—" (no data), marker parked at min, no band.
min number 0 domain.
max number 100 domain.
low number — tolerance-band bounds; no band if absent.
high number — tolerance-band bounds; no band if absent.
setpoint number — target marker tick.
warn number — outer escalation thresholds.
crit number — outer escalation thresholds.
label string — caption above the rail.
unit string — appended to the readout.
width number 200 px.
format string — number | compact | percent | bytes | duration | currency; the readout's number format
precision string — fraction digits of the formatted value
currency string — ISO 4217 code when format=currency
locale string — BCP 47 locale for formatting; defaults to the page locale
state string — live | loading | stale | offline | unknown; sets data-state on the host
updated-at string — time of the last sample (ISO or epoch ms); drives the age caption
stale-after string — seconds after updated-at at which the element reads stale
static string — boolean; turns motion off for this element only
duration string — transition length in ms
invert boolean — the window is a keep-out zone: inside reads warning, outside nominal (off the rail stays critical)

Properties and methods

MemberTypeDescription
.value number | null The current reading; mirrors the `value` attribute (null = no data).

Events

EventTypeDescription
talos:band CustomEvent<BandEventDetail> Fired when the band changes (not on first render): detail { from, to, value }. Bubbles and is composed.

CSS parts

::part(band), ::part(caption), ::part(marker), ::part(rail), ::part(readout), ::part(setpoint)