Instruments LED
// LED

LED

A single status light — colour is the state, pulse means live. The honest replacement for a hand-coloured status dot.

<talos-led> is the smallest instrument: one dot whose colour is a state and whose pulse means “live”. Drive it qualitatively with state (ok / warn / crit / idle), or bind a numeric value against warn/crit thresholds and let it band like the gauge and meter. The colour is bound, not decorative — the state survives in a single static frame (and an aria-label) without colour or motion. Every attribute is reactive.

State — ok / warn / crit / idle

LIVE
<talos-led state="ok"></talos-led>
<talos-led state="warn"></talos-led>
<talos-led state="crit"></talos-led>
<talos-led state="idle"></talos-led>

state drives a direct qualitative colour: ok → --talos-success, warn → --talos-warning, crit → --talos-danger, idle → --talos-muted-foreground (muted, “nothing to report”). Default is ok.

Live — pulse

PREVIEW
<talos-led state="ok" live></talos-led>
<talos-led state="crit" live></talos-led>

live makes the dot pulse — a slow steady beat meaning the channel is actively reporting, not a decorative shimmer. Drop live and the light holds steady, which is still a valid readable state. Under prefers-reduced-motion the pulse is dropped but the lit colour is held.

Banded — value + warn / crit

PREVIEW
<talos-led value="40" warn="60" crit="85"></talos-led>
<talos-led value="72" warn="60" crit="85"></talos-led>
<talos-led value="92" warn="60" crit="85"></talos-led>

A numeric value is banded against warn/crit via the shared band helper: value >= crit → critical, else value >= warn → warning, else nominal. If both value and state are present, the live reading wins.

Inverted — low is bad

PREVIEW
<talos-led value="80" warn="40" crit="20" invert></talos-led>
<talos-led value="32" warn="40" crit="20" invert></talos-led>
<talos-led value="15" warn="40" crit="20" invert></talos-led>

invert flips the comparison: warning/critical trip when value falls to/below the threshold. For “low = bad” signals — battery, coolant reserve, signal strength — a dangerously low reading reads red. Same semantics as the gauge.

Size

PREVIEW
<talos-led state="ok" size="8"></talos-led>
<talos-led state="ok" size="14"></talos-led>
<talos-led state="ok" size="24"></talos-led>

size is the px diameter of the dot (default 10). The pulse glow scales from it.

Behaviour

All attributes are reactive — re-set any of them and the light re-renders. Exposes role="status" with an aria-label carrying the resolved state, so the meaning survives without colour or motion. Shares its band model (warn/crit/invert) with <talos-gauge>.

Attributes

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

AttributeTypeDefaultDescription
value number — numeric reading; banded by warn/crit.
warn number — band thresholds on `value`.
crit number — band thresholds on `value`.
invert boolean — low = bad (band trips as value FALLS)
live boolean — pulse to signal an actively-reporting channel.
label string — accessible label / state caption.
size number 10 px diameter.
state string ok ok | warn | crit | idle, or nominal | warning | critical.
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

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(dot)