KPI Card
A card with a KPI label, a value, and the percentage change versus the previous period.
Ventas realizadas
+12.5%
42
Paquetes entregados
-4.2%
318
Incidencias reportadas
-18.0%
3
Installation
pnpm dlx shadcn@latest add @ecodeliver/kpi-cardUsage
type picks the Spanish label and Lucide icon. For incidents and expiredPackages, a decrease is treated as favourable (green). unit is part of the payload but is not shown.
earnings is in the type union but has no label or icon mapping, so it will render without either.
import { KPICard } from "@/components/registry/kpi-card";
export function Example() {
return (
<KPICard
kpi={{
type: "sales",
value: 42,
changePercentage: 12.5,
unit: "package",
}}
/>
);
}API Reference
KPICard
The KPICard component displays one KPI.
| Prop | Type | Default |
|---|---|---|
kpi | object | - |
kpi
| Prop | Type | Default |
|---|---|---|
type | "sales" | "receivedPackages" | "deliveredPackages" | "clientReturns" | "incidents" | "expiredPackages" | "earnings" | "commissionSales" | - |
value | number | - |
changePercentage | number | - |
unit | "EUR" | "%" | "package" | - |