KPI Group

A layout component for arranging multiple KPI cards in horizontal or vertical stacks with consistent spacing.

Usage

Anatomy

Import the KPIGroup component and access all parts using dot notation.

import { KPIGroup } from "@thenamespace/uikit";

<KPIGroup>
  <KPIGroup.Separator />
</KPIGroup>;

Vertical

Revenue
$228,451
+3.3%
Expenses
$25,108
-3.3%
Profit
$203,133
+4.1%
// @ts-nocheck -- Complex demo data intentionally uses heterogeneous shapes.
"use client";

import { Fragment } from "react";

With From Suffix

Total Subscribers
71,897
from 70,946
12%
Avg. Open Rate
58.16%
from 56.14%
2.02%
Avg. Click Rate
24.57%
from 28.62%
4.05%
"use client";

import { Fragment } from "react";

import { KPIGroup } from "@thenamespace/uikit";

Horizontal

Total Subscribers
71,897
12%
Avg. Open Rate
58.16%
2.02%
Avg. Click Rate
24.57%
4.05%
"use client";

import { Fragment } from "react";

import { KPIGroup } from "@thenamespace/uikit";

CSS Classes

Base Classes

  • .kpi-group - Base group container with shared surface background and rounded corners

Orientation Classes

  • .kpi-group--horizontal - Horizontal layout with equal-width children
  • .kpi-group--vertical - Vertical layout stacking children

Element Classes

  • .kpi-group__separator - Divider between KPI cards (width or height based on orientation)

API Reference

KPIGroup

The root component. Groups KPI cards with shared styling.

PropTypeDefaultDescription
orientation'horizontal' | 'vertical''horizontal'Layout direction
childrenReactNode-KPI cards and separators

Also supports all native div HTML attributes.

KPIGroup.Separator

A visual divider between KPI cards. Renders as a 1px line.

Also supports all native span HTML attributes.