Skip to content
Neon UI
Esc
navigateopen⌘Jpreview
On this page

HealthCard

A project health rollup on the MetricCard shell, naming an overall status over a quiet grid of supporting signals.

HealthCard rolls a surface’s health into one card on the MetricCard shell. The overall status is the light: a faint status-tinted grain wash rises from the bottom edge and a mono pill names it, both drawn from the house status vocabulary — active green, scaling amber, sleeping gray, destructive red. Beneath, the supporting signals (latency, error rate, uptime) read as a calm mono grid, and a signal only takes color when it is the reason the rollup is not green. It is presentational: the numbers come from your monitoring or the Neon API — see the example.

Production

All systems operational.

healthy
Latency p99

42 ms

Error rate

0.01%

Uptime 30d

99.99%

Compute

active

checked 12s ago

Status

Worst-first: down outranks degraded, which outranks maintenance, which outranks healthy. The status drives the pill and the wash; a signal’s own status tints only its dot.

Production

All systems operational.

healthy
Latency p99

42 ms

Error rate

0.01%

Uptime 30d

99.99%

Compute

active

checked 12s ago

Production

Elevated latency in aws-us-east-2.

degraded
Latency p99

318 ms

Error rate

0.4%

Uptime 30d

99.94%

Compute

scaling

checked 8s ago

Production

Database unreachable; connections failing.

down
Latency p99

Error rate

37%

Uptime 30d

99.61%

Compute

unreachable

checked 3s ago

Install

npx shadcn@latest add https://ui.neon.com/r/health-card.json

Usage

import { HealthCard } from "@/components/neon-ui/health-card";

<HealthCard
  label="Production"
  status="degraded"
  summary="Elevated latency in aws-us-east-2."
  signals={[
    { label: "Latency p99", value: "318 ms", status: "degraded" },
    { label: "Error rate", value: "0.4%" },
    { label: "Uptime 30d", value: "99.94%" },
  ]}
  updatedAt="checked 8s ago"
/>;

Wiring to Neon

A server component derives health from a project’s recent operations: failures pull the rollup down, in-flight work reads as maintenance, an all-clear history is healthy.

import { createNeonClient } from "@/lib/neon-client";

const neon = createNeonClient(process.env.NEON_API_KEY);
const { data } = await neon.operations.list(projectId).page();

const failed = (data?.items ?? []).filter(
  (op) => op.status === "failed" || op.status === "error"
).length;

Props

PropType
labelstring

Rollup title, e.g. a project name.

Typestring
status"healthy" | "degraded" | "maintenance" | "down"

Overall status, driving the pill and the top wash.

Type"healthy" | "degraded" | "maintenance" | "down"
summary?string

One-line human summary, e.g. "All systems operational".

Typestring
signals?HealthSignal[]

Supporting figures. Each has a label, a preformatted value, and an optional status that tints its dot.

TypeHealthSignal[]
updatedAt?string

Last check, already formatted, e.g. "checked 30s ago".

Typestring
isLoading?boolean

Render the skeleton state.

Typeboolean
Defaultfalse
error?Error | string | null

Render the error state with the message.

TypeError | string | null
Defaultnull

Colors are the light

Every color comes from the status vocabulary, never from ad-hoc values:

  • healthy--status-active (green)
  • degraded--status-scaling (amber)
  • maintenance--status-sleeping (gray)
  • down--destructive (red)

Signal text stays muted so a grid of cards reads calm; a signal earns color only by carrying its own status. There is no motion.

Accessibility

Status never rests on color alone: the pill pairs its dot with the status word, and each colored signal keeps its figure and caption. Loading sets aria-busy; the error state is a role="alert" with the message in text.