About Shadcn UI KPI Cards Blocks
A KPI card shows a key performance indicator together with the yardstick it is judged by: a target, a plan limit, a score or the recent trend. These 16 shadcn KPI card blocks turn that comparison into a visual, using meters, sparklines, segmented bars, scores and progress bars next to the value.
Every card is built with React, TypeScript and Tailwind CSS on top of shadcn ui components such as Card, Badge, Progress, Item, Toggle Group, Select, Switch, Tooltip and Chart. The sample data covers subscriptions, hiring, cloud infrastructure, support, security, e-commerce, publishing, travel and marketing.
Key Elements of a KPI Card
- Value and unit: one number formatted with its currency, percentage or unit.
- Yardstick: a limit, target, score or previous period that gives the number meaning.
- Visual cue: a tick meter, sparkline, histogram or share bar that shows how close the value is to the yardstick.
- Status: a badge or color that says whether the value needs attention.
- Next step: a link, button or menu that leads to the details.
Layouts in This Collection
- KPI rows: KPI Card 1, KPI Card 6, KPI Card 10 and KPI Card 11 place four metrics in one divided card.
- Usage meters: KPI Card 2, KPI Card 7 and KPI Card 12 use tick meters for limits and scores.
- Breakdowns: KPI Card 3, KPI Card 4, KPI Card 14, KPI Card 15 and KPI Card 16 split a total with a segmented bar.
- Detail cards: KPI Card 5, KPI Card 8, KPI Card 9 and KPI Card 13 combine a headline metric with lists, metric grids or selectable segments.
Related Blocks
- Stat Cards: simpler metric cards with change badges and charts.
- Charts: full size charts to place below a KPI row.
- Dashboard Shell: a sidebar and header layout to hold the cards.
Accessibility
Tick meters in KPI Card 2, KPI Card 7 and KPI Card 12 use role="meter" with aria-valuenow and a label. Icon only buttons, selects and the segment toggle group carry aria-labels, and the selectable segments in KPI Card 9 are toggle items that work with the keyboard. Changes are shown with a sign or an arrow next to the color, so they do not rely on color alone.
Shadcn KPI Cards Blocks for AI Agents
Unlike plain stat tiles, these 16 cards each focus on one operational question, such as plan usage against limits, hiring pipeline stages, cluster capacity, support queue health, security posture, live storefront traffic or bookings by type. An agent can pick the card whose visual fits the metric, like a tick meter, segmented bar or mini histogram, and compute its values from your data.
Install it with an AI agent
Claude Code, Cursor, Codex and other agents can install these with the shadcn CLI, for example npx shadcn@latest add @shadcnuikit/kpi-card1. With the Shadcn UI Kit MCP server, your agent can search every variant by name and add the right one for you. To give it full context, share /blocks/dashboard-ui/kpi-cards.md, the Markdown version of this page with every variant and install command.
Example prompts
- “Add KPI Card 2 to billing settings and show storage, bandwidth, databases and collaborators used against plan limits from our API.”
- “Use KPI Card 6 on the support dashboard with the 30 day queue histogram built from our ticket counts.”
- “Put KPI Card 13 on the ads page so the period select refetches impressions, clicks and return on spend.”
Customize it with AI
Values in these cards are hardcoded, so ask the agent to pull them into a typed props object and calculate percentages and change figures in one place. Up and down colours should follow whether a rise is good for that metric, which is easy to get wrong for things like churn or response time. Keep the tooltips on segmented bars, because they carry the exact counts.
KPI Cards FAQ
npx shadcn@latest add @shadcnuikit/kpi-card1 or kpi-card2. The other 14 KPI cards are part of All Access.bg-primary, bg-chart-3, text-success, bg-warning and text-destructive, so they follow the variables in your globals.css in light and dark mode. Change those variables to restyle all cards at once.
