Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Data

Stat <pm-stat>

Stat / KPI: a labelled number with an optional change indicator. Trend is inferred from the sign of delta unless set; inverse flips colours (e.g. costs, latency).

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/icon'; import '@prismora/elements/sparkline'; import '@prismora/elements/stat'; import { registerIcons } from '@prismora/elements/icon'; import { users, wallet } from '@prismora/icons'; registerIcons([users, wallet]); </script> <pm-stat label="Monthly revenue" value="$48,210" delta="+12.5%" trend="up" description="vs. last month" icon="wallet"></pm-stat> <pm-stat label="Churn" value="2.1%" delta="+0.4%" trend="up" inverse description="vs. last month"> <pm-icon slot="icon" name="users"></pm-icon> <pm-sparkline type="area" values="1.4,1.5,1.5,1.7,1.8,2.0,2.1" label="Churn, last 7 months" tone="danger"></pm-sparkline> </pm-stat>

Sizes

Set with the size attribute; controls keep touch-sized targets on phones.

size="sm"
size="md"
size="lg"

Attributes

AttributeTypeDefaultDescription
iconstring—Registered icon name (see registerIcons); an icon slot overrides it.
labelstring—Accessible name (and visible label where the component shows one).
valuestring—Current value.
deltastring—Change, e.g. "+12%" or "-3".
descriptionstring—Supporting text under the title.
trend'up' | 'down' | 'neutral'—Direction of the change: up, down or flat (colours the delta).
inverseboolean—A decrease is good (e.g. error rate).
size'sm' | 'md' | 'lg'—Size: sm, md or lg (md when not set).

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Slots

SlotDescription
iconIcon next to the label.
(default)Extra footer content (sparkline, link).

Used in templates

Overview dashboardTraffic analyticsOrdersCustomer 360Team and rolesUser profileLanding page