KpiGroup
Loading example…
Metrics that belong together in one card, divided by hairlines. Columns follow the container width: 1, 2 or 4 across.
Import
Section titled “Import”import { KpiGroup } from "@jcsoftdev/ui/containers";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/containers/kpi-group.
<KpiGroup items={items} animate />| Prop | Type | Default | Description |
|---|---|---|---|
items * |
KpiGroupItem[] |
||
layout |
"divided" | "auto-fit" |
"divided" |
divided (default): one card, 1, 2 or 4 columns by container width. auto-fit: separate cards in as many columns as fit minItemWidth. |
minItemWidth |
number |
150 |
Minimum tile width in px for layout="auto-fit". |
minColumns |
2 | 1 |
1 |
Columns on the narrowest containers. 1 (default) stacks the tiles; 2 keeps two across (and auto-fit never goes below two) for short tiles on a phone. |
animate |
boolean |
true |
Animate numeric values counting up. |
classNames |
Partial<Record<KpiGroupPart, string>> |
Per-part classes merged with cn; consumer classes win. className still targets the root wrapper and is merged last. |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/containers/kpi-group/kpi-group.tsx