Skip to content

StackLight

Signal tower with 1 to 5 tiers (IND-020 .. IND-022, IEC 60073 colors).

StackLight, light theme StackLight, dark theme

Indicators, discrete · Widget catalog · API reference · schema stacklight.schema.json

Example

The traits of the picture above:

ai.StackLight(
    value=["blink", "off", "on", "off"],
    label="StackLight",
    tiers=["red", "amber", "green", "blue"],
    labels=["Fault", "Warning", "Running", "Call"],
    buzzer=True,
    size=(140, 200),
)

Traits

Trait Type Default Set by Description
mode "control", "indicator" "indicator" host "control": the user sets the value; "indicator": display only.
size array [120,200] host [width, height] in CSS pixels.
tiers array of enum ["red","amber","green"] host Tier colors from top to bottom.
labels array of string [] host Meaning of each tier, shown as text (A11Y-003).
value array of enum [] host State of each tier. Resolved to one state per tier: missing states are off, extra ones ignored, an unknown state reads as off (the Python class pads or cuts the list when the tiers change).
buzzer boolean false host Show a sounding buzzer indicator (no sound is played).
Common traits (7), shared with other widgets
Trait Type Default Set by Description
label string "" host Plain text, never interpreted as HTML (SEC-002).
disabled boolean false host Greyed out, input rejected.
visible boolean true host
tooltip string "" host Plain text shown on hover.
style "modern", "classic", "system" "modern" host
theme "auto", "light", "dark", "system" "auto" host "auto": the style decides; "system": the host page or the operating system (STYLE-007).
skin object {} host Replaceable drawing parts: part name -> SVG source, sanitized (STYLE-005, STYLE-006).

Set by: host, the program (Python, Julia, ...); widget, the user through the widget; derived, computed from other traits by the host that owns the state, or by the widget. See the trait contract.