Status

<o-status> shows the health of a set of things as colored segments, in layers when they are grouped.

Each item is an <o-arc> with a value, so the segments stack around the ring. The middle counts the problems; point at a segment or focus it and the middle shows that item instead.

Layers

Items with children become an inner ring of groups, each as wide as its children on the outer ring. A group without its own status takes the worst one of its children.

Attributes

AttributeDefaultWhat it does
data[]Items: [{ label, status, note?, color?, value?, children? }], up to three levels deep.
labelA title in the middle, above the count.
labelsoffWrites each label along its segment. Keep labels short: text longer than its arc is cut.
pulseoffError segments pulse, except with reduced motion.
range / from360 / autoArc span and start angle.
thickness2.4, 2 with layersRing thickness in lanes.
gap0.8Space between segments, in percent of the widget width.
shapenoneSegment endings.
size220pxWidth of the widget.
themedark, light or glass. Also inherited from an ok-theme-* class on a container. See Shared options.
StatusAlso acceptedColor
okgood, up, healthy, success#16a34a
warnwarning, degraded#d97706
errordown, critical, fail, failed, danger#dc2626
infomaintenance#2563eb
offunknown, idle, disabled, anything else#475569

note adds a detail to the item's name and to the middle while it is shown. color overrides the status color of one item; value is passed back in select untouched.

Events

NameWhat it does
selectA segment was clicked, or activated with Enter or Space. event.detail has label, status, note, value, item and path, the indexes from the top level.

Styling

PropertyDefaultWhat it does
--ok-status-ok#16a34aOK segments and text.
--ok-status-warn#d97706Warnings.
--ok-status-error#dc2626Errors.
--ok-status-info#2563ebInfo.
--ok-status-off#475569Off and unknown.
--ok-status-text#fffLabels on the segments.
--ok-font-size4.6cqminLabel size, as a share of the widget. The middle scales with it.

More examples

Reacting to a selection

Many small checks

A light, half-ring version

Accessibility

The element has role="group" and a name that counts each status, like “Services: 1 error, 1 warning, 3 ok”. Each segment is a button named after its item, such as “DB: Warning, slow queries”, so status is never only a color.

The ring is one tab stop. Left and Right move around a ring, Up goes out to the first child of a group, Down comes back in to the group, Home and End jump to the ends, Enter and Space fire select.