HealthCard
neon-ui/health-cardFreeComponent
Project health rollup on the MetricCard shell: an overall status pill and tint over a mono grid of supporting signals (latency, errors, uptime).
Install it
npx shadcn@latest add https://ui.neon.com/r/health-card.jsonSource
1"use client";23import { Alert02Icon } from "@hugeicons/core-free-icons";4import { HugeiconsIcon } from "@hugeicons/react";5import type { ComponentProps } from "react";67import { NeonLoader } from "@/components/neon-loader/neon-loader";8import { Skeleton } from "@/components/ui/skeleton";9import { cn } from "@/lib/utils";1011/** Operational health of a surface, worst-first: down > degraded > maintenance > healthy. */12export type HealthStatus = "healthy" | "degraded" | "maintenance" | "down";1314export interface HealthSignal {15 /** Short mono caption, e.g. "Latency p99". */16 label: string;17 /** Preformatted figure, e.g. "128 ms" or "99.98%". */18 value: string;19 /** Optional tint for this signal's dot; omit for no color. */20 status?: HealthStatus;21}2223/* ─────────────────────────────────────────────────────────24 * HEALTH ROLLUP, on the MetricCard shell25 *26 * The overall status is the light: a faint status-tinted27 * grain wash rises from the bottom edge and a mono pill28 * names it,29 * both drawn from the house status vocabulary — active30 * green, scaling amber, sleeping gray, destructive red.31 * Beneath, the supporting signals (latency, errors, uptime)32 * read as a quiet mono grid; a signal only takes color when33 * it is the reason the rollup is not green. Text stays34 * muted so a wall of cards reads calm. No motion.35 * ───────────────────────────────────────────────────────── */36const STATUS_DOT: Record<HealthStatus, string> = {37 degraded: "bg-[var(--status-scaling)]",38 down: "bg-destructive",39 healthy: "bg-[var(--status-active)]",40 maintenance: "bg-[var(--status-sleeping)]",41};4243/** Wash tint: set as text color so neon-card-wash reads `currentColor`. */44const STATUS_TINT: Record<HealthStatus, string> = {45 degraded: "text-[var(--status-scaling)]",46 down: "text-destructive",47 healthy: "text-[var(--status-active)]",48 maintenance: "text-[var(--status-sleeping)]",49};5051const STATUS_LABEL: Record<HealthStatus, string> = {52 degraded: "degraded",53 down: "down",54 healthy: "healthy",55 maintenance: "maintenance",56};5758const HealthBadge = ({59 status,60 label,61}: {62 status: HealthStatus;63 label?: string;64}) => (65 <span66// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from neon-ui
All 77 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ActivityFeedactivity-feed | neon-ui | Components | Free | 2 deps | |
| AgentChatagent-chat | neon-ui | Components | Free | 6 deps | |
| AnimatedWashanimated-wash | neon-ui | Components | Free | no deps · 2 files | |
| ApiKeyListapi-key-list | neon-ui | Components | Free | 2 deps | |
| AppCardapp-card | neon-ui | Components | Free | 2 deps | |
| AppCreatorapp-creator | neon-ui | Components | Free | 2 deps | |
| AuthFormauth-form | neon-ui | Components | Free | no deps | |
| AutoscaleChartautoscale-chart | neon-ui | Components | Free | 1 dep |
