StatusPill
HkStatusPill is the compact health indicator for anything with a liveness: a hub connection, an edge node, a station. One pill carries a coloured dot, an optional word beside it, an optional round-trip latency and an optional version — and nothing else, so it can sit inline in a header, a table cell or a node list.
- The pill answers "is it up, and how far away is it"; when the health needs a title, a status line and a trailing action, that row is HkStatusRow.
- A state that must be announced politely belongs in the pill's role="status"; a state that is really a count or a badge belongs in a label, not here.
- The dot alone says nothing to a screen reader: give the pill a label whenever the state matters.
Import
import { HkStatusPill } from "@celestia-island/hikari";
use hikari_components::*; use hikari_components::prelude::*;
States
Four states, unknown by default: ok (the live dot pulses), warn, error and unknown. The state is a pure CSS modifier on the root — the pill holds no state of its own — so the dot's colour, the pulse and its reduced-motion opt-out all follow from the class.
import { HkStatusPill } from "@celestia-island/hikari";
import type { CSSProperties } from "vue";
const row: CSSProperties = { display: "flex", flexWrap: "wrap", gap: "12px", alignItems: "center" };
export default () => (
<div style={row}>
<HkStatusPill state="ok" label="hub" />
<HkStatusPill state="warn" label="edge-2" />
<HkStatusPill state="error" label="edge-3" />
<HkStatusPill state="unknown" label="station-7" />
</div>
);
rsx! {
div { style: "display:flex;flex-wrap:wrap;gap:12px;align-items:center",
StatusPill { state: StatusPillState::Ok, label: "hub".to_string() }
StatusPill { state: StatusPillState::Warn, label: "edge-2".to_string() }
StatusPill { state: StatusPillState::Error, label: "edge-3".to_string() }
StatusPill { state: StatusPillState::Unknown, label: "station-7".to_string() }
}
}
import { HkStatusPill } from "@celestia-island/hikari";
import type { CSSProperties } from "vue";
const row: CSSProperties = { display: "flex", flexWrap: "wrap", gap: "12px", alignItems: "center" };
export default () => (
<div style={row}>
<HkStatusPill state="ok" label="hub" />
<HkStatusPill state="warn" label="edge-2" />
<HkStatusPill state="error" label="edge-3" />
<HkStatusPill state="unknown" label="station-7" />
</div>
);rsx! {
div { style: "display:flex;flex-wrap:wrap;gap:12px;align-items:center",
StatusPill { state: StatusPillState::Ok, label: "hub".to_string() }
StatusPill { state: StatusPillState::Warn, label: "edge-2".to_string() }
StatusPill { state: StatusPillState::Error, label: "edge-3".to_string() }
StatusPill { state: StatusPillState::Unknown, label: "station-7".to_string() }
}
}Latency and version readouts
latencyMs appends the round-trip figure with the ms unit; version appends the service version. Both are gated on being present: a latency of 0 is a real reading and renders, while an absent latency renders nothing at all. An empty label or version renders no span either.
The unit comes from the i18n table (Vue key hikari::statusPill.ms, Rust key components.hk.statusPill.ms), both defaulting to a leading space so the number and the unit share one span.
online34 ms0.2.0degraded180 msoffline0 ms
online34 ms0.2.0degraded180 msoffline0 ms
import { HkStatusPill } from "@celestia-island/hikari";
import type { CSSProperties } from "vue";
const row: CSSProperties = { display: "flex", flexWrap: "wrap", gap: "12px", alignItems: "center" };
export default () => (
<div style={row}>
<HkStatusPill state="ok" label="online" latencyMs={34} version="0.2.0" />
<HkStatusPill state="warn" label="degraded" latencyMs={180} />
<HkStatusPill state="error" label="offline" />
<HkStatusPill state="unknown" latencyMs={0} />
</div>
);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
rsx! {
div { style: "display:flex;flex-wrap:wrap;gap:12px;align-items:center",
StatusPill {
state: StatusPillState::Ok,
label: "online".to_string(),
latency_ms: Some(34.0),
version: "0.2.0".to_string(),
}
StatusPill {
state: StatusPillState::Warn,
label: "degraded".to_string(),
latency_ms: Some(180.0),
}
StatusPill { state: StatusPillState::Error, label: "offline".to_string() }
StatusPill { latency_ms: Some(0.0) }
}
}
import { HkStatusPill } from "@celestia-island/hikari";
import type { CSSProperties } from "vue";
const row: CSSProperties = { display: "flex", flexWrap: "wrap", gap: "12px", alignItems: "center" };
export default () => (
<div style={row}>
<HkStatusPill state="ok" label="online" latencyMs={34} version="0.2.0" />
<HkStatusPill state="warn" label="degraded" latencyMs={180} />
<HkStatusPill state="error" label="offline" />
<HkStatusPill state="unknown" latencyMs={0} />
</div>
);rsx! {
div { style: "display:flex;flex-wrap:wrap;gap:12px;align-items:center",
StatusPill {
state: StatusPillState::Ok,
label: "online".to_string(),
latency_ms: Some(34.0),
version: "0.2.0".to_string(),
}
StatusPill {
state: StatusPillState::Warn,
label: "degraded".to_string(),
latency_ms: Some(180.0),
}
StatusPill { state: StatusPillState::Error, label: "offline".to_string() }
StatusPill { latency_ms: Some(0.0) }
}
}
API
Vue
Props
Rust
Props — StatusPill
Accessibility
- The root is a span with role="status", so a state change is announced as a live-region update rather than as decoration.
- The dot is aria-hidden="true"; the accessible content is the label, the latency and the version text, in that order.
- A label-less pill still announces something only through those readouts. When the state itself matters to a screen-reader user, pass label — the colour of the dot is not available to them.
- The ok pulse is animation only: the reduced-motion media query stops it, and the state stays readable as a static dot and label.
Related components
- HkStatusRow — the full status card row: rail, chip, title plus status line and an optional action.
- HkIconChip — the decorative leading glyph used inside rows and cards.
- HkTagDotRow — the same compact-inline idea, but as a toggle control instead of a readout.