Lambchop
Data Display

KpiCard

Key performance indicator card with optional trend, sparkline, and icon.

import { KpiCard } from "lambchop";

Live Demo

Total Revenue
$18,230
12.4%
Ad Revenue
$3,180
5.7%
Monthly Revenue
$14,520
8.3%
Active Writers
24

Usage

import { KpiCard } from "lambchop";

<KpiCard
  label="Total Revenue"
  value="$18,230"
  trend={{ value: 12.4, isPositive: true }}
  sparklineData={[1250, 1380, 1420, 1510, 1620, 1750, 1910, 2050]}
/>

Props

PropTypeDefaultDescription
labelstringMetric label displayed above the value
valuestring | numberThe main KPI value
trend{ value: number; isPositive: boolean }Optional trend indicator with percentage
sparklineDatanumber[]Optional array of numbers for inline sparkline
iconReact.ReactNodeOptional icon displayed in the card
classNamestringAdditional CSS classes

Variants

  • Basic — Label and value only
  • With Trend — Shows a percentage change indicator (green for positive, red for negative)
  • With Sparkline — Renders a mini area chart inline
  • With Icon — Displays a custom icon alongside the metric
  • All Features — Combines trend, sparkline, and icon