Block 250 of 297
Uptime Status
A status-page widget: overall banner, per-service status and uptime, and a bar for each day of history.
- Puck key
- UptimeStatusBlock
- Export
- uptimeStatusBlock
- React component
- <UptimeStatus />
- Path
- components/puck/uptime-status-block.tsx
- Dependencies
- None
- License
- MIT
About this block
When to use it, how to write for it, and what to change in the code.
What it's for
A status-page card: a banner that works out the overall state from your services, then one row per service with its status, uptime percentage and a bar per day of history. Bars show up to 90 days, or the last 30 when the card is narrow. Uptime figures can be bound to a monitor with a {{ source.field }} token.
- A public status page for donation, registration or member portals
- An IT dashboard for a school district or city department
- A client reporting page covering site and service availability
Writing the content
- Set Current status on each service; the banner reads All systems operational, Degraded, Partial outage or Major outage from those choices.
- Enter Daily history as comma-separated values, oldest first: 1 for up, 0.5 for degraded, 0 for down. Thirty to ninety values work best.
- Leave Uptime (%) blank to calculate it from the history. The figure is rounded down, so 99.996 shows as 99.99 rather than 100.
Accessibility
- Each status pairs an icon with a text label and a hidden "Status:" prefix, and the banner is written out, so state is not conveyed by color alone (WCAG 1.4.1).
- Each history strip is an SVG with role="img" and an aria-label summarizing the days, and each bar has a title tooltip naming its day.
- The legend is a labeled list that spells out every day state.
Customizing the code
- Status colors and icons live in the STATUS, BANNER and DAY maps.
- The switch from 30 to 90 bars is a container query (@md:block), so it follows the card's width rather than the screen's.
Editor fields
What content editors see in the P1 sidebar when they select this block.
- Titletext
- Heading levelselect
- Subtitletext
- Servicesarray
- Footnotetext