Skip to main content

KpiCardsGrid

A responsive grid of metric cards that display a KPI value, label, trend indicator, and optional icon.

πŸ“– Storybook

Preview​

Import​

import { KpiCardsGrid } from "@xocialive/ui-components";

Basic usage​

<KpiCardsGrid
cards={[
{
label: "Total Users",
value: 1284,
trend: +12.4,
icon: <PeopleIcon />,
},
{
label: "Active Projects",
value: 47,
trend: -3.1,
icon: <FolderIcon />,
},
{
label: "Revenue",
value: 284500,
format: "currency",
trend: +8.9,
},
]}
/>

KpiCard config​

FieldTypeDescription
labelstringCard title
valuenumber | stringMetric value
trendnumberPercentage change (positive = up, negative = down)
iconReactNodeOptional icon
format"number" | "currency" | "percent"Value display format
colorstringAccent colour override

Props​

PropTypeDefaultDescription
cardsKpiCardConfig[]β€”Card definitions
columnsPartial<Record<Breakpoint, number>>{ xs: 1, sm: 2, md: 4 }Responsive grid columns
isLoadingbooleanfalseShows skeleton cards
sxSxProps<Theme>β€”Grid wrapper style overrides