KPI Group
A layout component for arranging multiple KPI cards in horizontal or vertical stacks with consistent spacing.
Usage
Mobile
Tablet
Desktop
Anatomy
Import the KPIGroup component and access all parts using dot notation.
import { KPI, KPIGroup } from "@blakeui/pro-react";
<KPIGroup>
<KPI />
<KPIGroup.Separator />
<KPI />
</KPIGroup>;Vertical
Mobile
Tablet
Desktop
With From Suffix
There is no from prop — the comparison figure is composed inside KPI.Value's render-prop children.
Mobile
Tablet
Desktop
CSS Classes
Base Classes
.kpi-group— The shared surface.background-color: --surface,box-shadow: --surface-shadow, andoverflow: hiddenso the member cards' square corners are clipped back to the group's own radius.
Orientation Classes
.kpi-group--horizontal—display: flex,flex-direction: row,border-radius: --radius * 2..kpi-group--horizontal > [data-slot="kpi"]—flex: 1for equal-width columns, plusborder-width: 0,border-radius: 0,box-shadow: noneso each card surrenders its own elevation to the group..kpi-group--horizontal > .kpi-group__separator—align-self: stretch,width: 1px, andmargin-block: --spacing * 4so the rule stops short of the top and bottom edges..kpi-group--vertical—display: flex,flex-direction: column,border-radius: --radius * 2..kpi-group--vertical > [data-slot="kpi"]—border-width: 0,border-radius: 0,box-shadow: none. Noflex: 1, so rows keep their natural height rather than dividing the column evenly..kpi-group--vertical > .kpi-group__separator—align-self: stretch,height: 1px, and no block margin, so the rule runs edge to edge.
Element Classes
.kpi-group__separator— The divider.flex-shrink: 0so it survives a crowded row, painted in--separator. The orientation classes above are what give it its 1px axis.
Data Attributes
[data-slot="kpi-group"]on the root and[data-slot="kpi-group-separator"]on the divider — so either part can be targeted without depending on its BEM class.[data-slot="kpi"]— Consumed, not defined: set byKPI, and the selector both orientation classes use to strip a member card's border, radius, and shadow. Anything else placed in the group keeps its own chrome.
API Reference
KPIGroup
The root. Renders a div with role="group" and supplies the slot context KPIGroup.Separator reads.
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | Layout direction. It also decides which axis KPIGroup.Separator draws on, so the same separator markup works in both — horizontal gives equal-width columns divided by vertical rules, vertical gives natural-height rows divided by horizontal ones. |
children | ReactNode | — | The member cards and their dividers. Separators are not inserted for you — render a KPIGroup.Separator before every card after the first. Only children marked data-slot="kpi" give up their border, radius, and shadow to the group. |
className | string | — | Merged onto .kpi-group, alongside the orientation modifier. |
Also accepts every native div attribute.
KPIGroup.Separator
The divider between cards. A span sized to 1px on whichever axis the group's orientation calls for.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Merged onto .kpi-group__separator. |
aria-hidden | boolean | true | The divider is decorative and hidden from assistive tech by default. It carries no orientation prop of its own — it reads the group's. |
Also accepts every native span attribute.