1Sponsor

Usage Monitor

Real-time dashboard with diamond header, progress metrics, burn rate, predictions, and status bar

Terminal

Installation

pnpm dlx shadcn@latest add https://termcn.dev/r/usage-monitor.json

Usage

import { UsageMonitor } from "@/components/ui/usage-monitor";
<UsageMonitor refreshInterval={2000}>
  <UsageMonitor.Header title="API Usage Dashboard" />
  <UsageMonitor.Tags items={["Pro Plan", "Billing: Monthly", "US-East"]} />
  <UsageMonitor.Section icon="📊" title="Requests">
    <UsageMonitor.Metric
      label="API Calls"
      value={8420}
      max={10000}
      percent={84.2}
      status="yellow"
      format="number"
    />
  </UsageMonitor.Section>
  <UsageMonitor.Stats>
    <UsageMonitor.StatRow label="Avg Latency" value="142ms" />
    <UsageMonitor.StatRow label="Error Rate" value="0.3%" valueColor="green" />
  </UsageMonitor.Stats>
  <UsageMonitor.StatusBar clock sessionLabel="dashboard" exitHint="q to quit" />
</UsageMonitor>

API Reference

UsageMonitor

PropTypeDefault
refreshIntervalnumber1000
separatorCharstring"─"
childrenReactNoderequired

UsageMonitor.Header

PropTypeDefault
titlestringrequired
titleColorstring"cyan"
decoratorstring"◆ ✦ ◆ ✦"
separatorCharstring"═"
separatorColorstringundefined

UsageMonitor.Tags

PropTypeDefault
itemsstring[]required
bracketColorstring"cyan"
separatorColorstring"cyan"

UsageMonitor.Section

PropTypeDefault
iconstringundefined
titlestringundefined
subtitlestringundefined
childrenReactNoderequired

UsageMonitor.Metric

PropTypeDefault
iconstringundefined
labelstringrequired
valuenumberrequired
maxnumberrequired
percentnumberrequired
status"green" | "yellow" | "red" | "blue"required
format"number" | "currency" | "duration" | "percent" | "custom"required
formatFn(v: number, max: number) => stringundefined
barWidthnumber22
barFillCharstring"█"
barEmptyCharstring"░"
barColorstring"white"
maxDimbooleanfalse
showMaxbooleantrue

UsageMonitor.DistributionMetric

PropTypeDefault
iconstringundefined
labelstringrequired
segments{ label: string; percent: number; color?: string }[]required
barWidthnumber22

UsageMonitor.Stats

PropTypeDefault
childrenReactNoderequired

UsageMonitor.StatRow

PropTypeDefault
iconstringundefined
labelstringrequired
valuestringrequired
valueSuffixstringundefined
valueColorstring"white"

UsageMonitor.Predictions

PropTypeDefault
childrenReactNoderequired

UsageMonitor.Prediction

PropTypeDefault
labelstringrequired
valuestringrequired
valueColorstring"yellow"

UsageMonitor.StatusBar

PropTypeDefault
clockbooleanfalse
clockColorstring"cyan"
sessionLabelstringundefined
sessionColorstring"green"
exitHintstringundefined
statusDot"green" | "yellow" | "red""green"
separatorstring" | "