Component Guide

Component Guide

Reusable UI primitives built on shadcn/ui with engineering-grade defaults.

Component Guide

SentinelGrid ships a curated set of components tailored for engineering operations dashboards. Every component is theme-aware, fully typed, and mobile-responsive.

Overview

Components live in three directories:

  • components/ui/ — shadcn/ui primitives (Button, Card, Dialog, etc.)
  • components/common/ — SentinelGrid-specific building blocks (KpiCard, badges, page-header)
  • components/charts/ and components/tables/ — data visualization wrappers

KpiCard

The KpiCard is the workhorse of every dashboard. It renders a label, large value, optional delta with directional arrow, sparkline, and an accent-colored icon.

Active Incidents

3
-2%vs last week

Uptime

99.97%
+0.02%30d

Avg MTTR

18min
-5%vs target

SLOs Healthy

42/47

5 at risk

KpiCard usage
<KpiCard
  label="Active Incidents"
  value={3}
  delta={-2}
  deltaLabel="vs last week"
  icon={<ShieldAlert className="w-4 h-4" />}
  accent="destructive"
/>

Badges

SentinelGrid provides a family of typed badges for every domain status. Each badge accepts the literal type from lib/types.ts, ensuring invalid states are caught at build time.

SeverityBadge

CriticalHighMediumLowInfo

IncidentStatusBadge

InvestigatingIdentifiedMonitoringResolvedPostmortem

ServiceHealthBadge

OperationalDegradedPartial OutageMajor OutageMaintenance

DeploymentStatusBadge

In ProgressRolling OutCanarySucceededFailedRolled Back

AlertStatusBadge / SLOStatusBadge / TierBadge

FiringAcknowledgedResolvedSuppressedHealthyAt RiskBreachedTier 1Tier 2Tier 3
Badge usage
<SeverityBadge severity="critical" />
<IncidentStatusBadge status="investigating" />
<ServiceHealthBadge health="operational" />
<DeploymentStatusBadge status="succeeded" />
<AlertStatusBadge status="firing" />
<SLOStatusBadge status="breached" />
<TierBadge tier="tier1" />

Charts Preview

All chart wrappers live in components/charts/ and read theme tokens from useChartTheme(). See the Charts Guide for full details.

LatencyChart

VolumeChart

ErrorRateChart

DonutChart

HorizontalBarChart

MTTRTrendChart

RadialGauge

ComposedChart

Props Reference

KpiCard

PropTypeDefaultDescription
labelstringUppercase label above the value
valuestring | numberPrimary metric value
unitstringOptional unit suffix (e.g. %, ms)
deltanumberPercent change. Positive = green, negative = red
deltaLabelstringContext for the delta (e.g. vs last week)
accentprimary | accent | success | warning | destructive | info | mutedprimaryColor of the icon container
iconReactNodeLucide icon to render in the accent box
sparklinenumber[]Mini trend chart on the right
hintstringSecondary text under the value

SeverityBadge

PropTypeDescription
severity"critical" | "high" | "medium" | "low" | "info"Severity level to render
size"default" | "sm"Compact size for inline use

Type safety

The badge components import their union types from lib/types.ts. This means a typo like status="supressd" fails at compile time instead of silently rendering an empty badge.

Command Palette

Search for a command to run...