Skip to content
Alea0.1
Pro
  1. Alea
  2. Components
  3. Data display
  4. UptimeBar

Data display

UptimeBar

A service's recent history as thin bars, one per day: green when it worked, amber when it was slow, red when it was down.

import { UptimeBar } from '@alea/ui';

Examples

A status page

One bar per day. The whole bar is read as a sentence with the uptime and the bad days.

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Color

  • --alea-status-danger…
  • --alea-status-success…
  • --alea-status-warning…
  • --alea-surface-raised…

Props

UptimeBar props

A service's recent history as thin bars, one per day: green, amber when it was slow, red when it was down. Read as one sentence.

PropTypeDefaultDescription
daysrequired"ok" | "degraded" | "down" | "none"[]-One state per day (or hour), oldest first.
labelrequiredstring-What it measures: "API gateway".
classNamestring-Extra class names for the root element.
unitstring'day'What one bar is: "day" (default) or "hour".
uptimenumber-The uptime to say, e.g. 99.98 (percent). Without it the bar is described by its incidents.

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

Variants
daysokdegradeddownnone"[]
Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-uptime
Data attributes
data-state=degradeddata-state=downdata-state=none

Accessibility

  • One image read as a sentence: the service, its uptime and how many days were slow or down.
  • States differ in color and are summed up in text, never color alone.

Do and don't

Do

  • Show 30 to 90 days.
  • Put the current status as text next to it.

Don't

  • Don't use it for values that are not a state per period: use Sparkline.

In Figma

Uptime bar with Days (30, 45, 90).

Tested with axe, keyboard and screen reader roles