Skip to content

Uptime Bar

One row of day bars for one service. Up, degraded, down or no data, a tooltip on hover or focus, one tab stop with the arrow keys to inspect days, and a spoken summary worked out from the data.

On this page
Used for
  • Model endpoint uptime
  • Provider status
  • Service health history
  • Incident timelines

Examples

With incidents

Compact

Custom range

Installation

npx knowns-ui@latest add uptime-bar
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

daysrequired
UptimeDay[]
One entry per day, oldest first: { date, status: up | degraded | down | none, downtimeMinutes?, note? }. date is a YYYY-MM-DD string or a Date (read in UTC).
label / sublabel
string
The service name and a muted line next to it. Without a label, pass aria-label.
uptime
number | null
Defaultcomputed
Overrides the percent worked out from days. null shows No data.
showUptime
boolean
Defaulttrue
The percent at the right of the label line.
startLabel / endLabel
string
Defaultn days ago / Today
The two ends under the bars. endLabel="" hides both.
size
"sm" | "md"
Default"md"
Bar height, 24 or 32 px.
onDaySelect
(day, index) => void
Enter, Space or a click on a day.
Uptime math
uptimePercent(days)
Days with no data are left out. downtimeMinutes count as downtime; a down day without minutes counts as a full day; a degraded day without minutes counts as none. 99.9999 is shown as 99.99%, never rounded up to 100%.
Keyboard
listbox
The row is one tab stop. Left and Right move the inspected day, Home and End jump to the first and last, Enter selects. The tooltip follows.
a11y
label
The row is named with a summary worked out from the data (uptime, incident count and the latest incidents with their minutes), and each day is announced as you move. Colour is never the only cue: the tooltip and the announcement say the status in words.
Narrow
container query
The bars share the width, the gap and the corners tighten under 448 px. There is no horizontal scroll.
Motion
tooltip
The tooltip and the dimming of other days fade in 120 ms. With reduced motion they change at once.

What it handles

  1. 01Draws one bar per entry of `days`, oldest first, coloured up, degraded, down or no data, for any number of days.
  2. 02Works out the uptime percent from the days and shows it beside the `label` and `sublabel`, unless you pass `uptime` or turn `showUptime` off.
  3. 03Shows a tooltip for the hovered or focused day, placed at the start, centre or end of the row so it never leaves the edge.
  4. 04Keeps the whole row as one tab stop with a listbox role, moves a cursor between days with the arrow keys and calls `onDaySelect` on Enter, Space or click.
  5. 05Names the row for screen readers with a summary of the days, and gives each bar an accessible label describing its status.
  6. 06Offers `quiet` to dim the up days so only trouble stands out, a `size` of sm or md, and `startLabel` and `endLabel` for the two ends of the row.

States

First render
Nothing. It paints as it is
none
Hover or focus on a day
The tooltip fades in over that bar
120ms, ease out
Pointer or focus leaves
The tooltip fades out where it was
120ms, ease out
Cursor moves by keyboard
The tooltip follows the selected day
none
Data change
The bars are replaced at once
none

Works with

When to use

When to use

  • Showing, day by day, whether one service was up, degraded or down over the last weeks or months.
  • A status page row where people want to inspect a bad day with the keyboard or a hover.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Uptime Bar to my app and wire it to my own data.
  • I need showing, day by day, whether one service was up, degraded or down over the last weeks or months. Set that up with the Knowns UI Uptime Bar.
  • Which Uptime Bar props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "uptime-bar" }) and search_docs({ query: "uptime bar" }).

Need help?

Stuck on Uptime Bar, or found something off? We read every message.