Computing for good
Atlanta Food Consortium/Feature Docs

KpiCard

A stat card showing a numeric value with an optional trend indicator and icon.

Overview

KpiCard displays a single key metric with an optional icon, trend arrow, and trend label. Used across the Admin, Supplier, and Nonprofit dashboards to surface summary stats at a glance.

Props

PropTypeRequiredDescription
valuestring | numberYesThe primary metric to display.
labelstringYesShort descriptor shown below the value.
iconLucideIconNoLucide icon component rendered top-right.
trendnumberNoPercentage change. Positive = green, negative = red.
trendLabelstringNoContextual text next to the trend arrow (e.g. "vs last month").
prefixstringNoString prepended to value (e.g. "$").

Usage

import KpiCard from '@/components/charts/KpiCard';
import { Package } from 'lucide-react';

<KpiCard
  value={142}
  label='Active Listings'
  icon={Package}
  trend={12.5}
  trendLabel='vs last month'
/>;

Currency example

<KpiCard
  value={3820}
  label='Total Value Claimed'
  prefix='$'
  trend={-3.2}
  trendLabel='vs last month'
/>

Trend coloring

trend valueColorIcon
> 0text-emerald-600up
< 0text-red-500down
0 or omittedNeutralHidden

Tip: Pass trend={0} to explicitly hide the trend indicator without omitting the prop entirely.

Source file: src/components/charts/KpiCard.tsx