- Stat
- Examples
- Basic Stat
- Currency Formatting
- Percentage Values
- Time Duration
- Delta Comparison
- Value First
- Padded
- Large
- Delta In Points
- Tile
- Selectable Tiles
- Icon
- Color Variants
- Dashboard KPIs
- Sales Metrics
- Performance Metrics
- User Engagement
- E-commerce Dashboard
- Financial Summary
- SaaS Metrics
- Marketing Campaign
- Support Dashboard
- Status Overview
- Large Numbers
- Importing
- Properties
- Dependencies
Stats Tile
<zn-stat>
ZnStatsTile
Displays a key metric, optionally compared with a previous value.
<zn-cols> <zn-panel> <zn-stat caption="Total Revenue" description="This month" amount="48250" previous="42100" currency="$" show-delta></zn-stat> </zn-panel> </zn-cols>
Examples
Basic Stat
A basic stat displays a caption, description, and amount.
<zn-cols> <zn-panel> <zn-stat caption="Total Users" description="Active accounts" amount="1247"></zn-stat> </zn-panel> </zn-cols>
Currency Formatting
Use the currency attribute to automatically format monetary values with proper comma separators
and decimal places.
<zn-cols> <zn-panel> <zn-stat caption="Monthly Revenue" description="January 2026" amount="125750.50" currency="$" color="success"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Total Sales" description="This quarter" amount="487999.99" currency="$" color="info"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Outstanding Balance" description="Accounts receivable" amount="23450" currency="$" color="warning"></zn-stat> </zn-panel> </zn-cols>
Percentage Values
Use type="percent" to display percentage metrics.
<zn-cols> <zn-panel> <zn-stat caption="Conversion Rate" description="Last 30 days" amount="4.8" type="percent" color="success"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Bounce Rate" description="Website visitors" amount="32.5" type="percent" color="warning"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Growth" description="Year over year" amount="127.3" type="percent" color="info"></zn-stat> </zn-panel> </zn-cols>
Time Duration
Use type="time" to display time values in seconds, which will be formatted as HH:MM:SS or
MM:SS.
<zn-cols> <zn-panel> <zn-stat caption="Avg. Session Time" description="User engagement" amount="245" type="time" color="info"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Processing Time" description="Last job" amount="3665" type="time" color="success"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Response Time" description="API average" amount="45" type="time" color="primary"></zn-stat> </zn-panel> </zn-cols>
Delta Comparison
Use the show-delta attribute with previous to show the percentage change from a
previous period.
<zn-cols> <zn-panel> <zn-stat caption="New Users" description="This week" amount="324" previous="280" show-delta color="success"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Revenue" description="This month" amount="45600" previous="52300" currency="$" show-delta color="error"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Conversion Rate" description="Last 30 days" amount="3.2" previous="3.2" type="percent" show-delta color="neutral"></zn-stat> </zn-panel> </zn-cols>
Value First
Use layout="value-first" to show the amount under the caption, with the description beneath it
in muted text. In this layout color tints the amount, so use color="neutral" for
plain figures and a semantic color to flag one. Each stat has a box of its own, so
zn-cols divide draws lines between them. The example adds size="large" for
headline figures.
<zn-panel caption="Last 30 days"> <zn-cols layout="1,1,1,1" divide> <zn-stat layout="value-first" size="large" caption="Quality score" description="Weighted by points" amount="88.9" previous="86.5" type="percent" delta-format="points" show-delta color="neutral"></zn-stat> <zn-stat layout="value-first" size="large" caption="Evaluations" description="Completed assessments" amount="42" color="neutral"></zn-stat> <zn-stat layout="value-first" size="large" caption="Fails" description="1 automatic" amount="3" color="error"></zn-stat> <zn-stat layout="value-first" size="large" caption="Kudos" description="From reviewers" amount="2" icon="award@lu" color="neutral"></zn-stat> </zn-cols> </zn-panel>
Padded
Use padded to give each stat its own padding, for stats laid edge to edge in a flush panel.
With zn-cols no-gap divide the dividers run the full height of the panel body.
<zn-panel caption="Last 30 days" flush> <zn-cols layout="1,1,1" no-gap divide stack-at="md"> <zn-stat layout="value-first" size="large" padded caption="Quality score" description="Weighted by points" amount="88.9" type="percent" color="neutral"></zn-stat> <zn-stat layout="value-first" size="large" padded caption="Evaluations" description="Completed assessments" amount="42" color="neutral"></zn-stat> <zn-stat layout="value-first" size="large" padded caption="Fails" description="1 automatic" amount="3" color="error"></zn-stat> </zn-cols> </zn-panel>
Large
Use size="large" to give the amount more weight, for a row of a few headline figures.
<zn-cols> <zn-panel> <zn-stat size="large" caption="Total Users" description="Active accounts" amount="1247"></zn-stat> </zn-panel> <zn-panel> <zn-stat size="large" caption="Conversion Rate" description="Last 30 days" amount="4.8" type="percent" color="success"></zn-stat> </zn-panel> </zn-cols>
Delta In Points
Use delta-format="points" with show-delta to show the difference between
amount and previous in points rather than the relative change. This suits values
that are already percentages.
<zn-cols> <zn-panel> <zn-stat caption="Pass rate" description="This month" amount="91.5" previous="88.2" type="percent" delta-format="points" show-delta color="success"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Error rate" description="Last 24 hours" amount="2.1" previous="3.4" type="percent" delta-format="points" show-delta color="neutral"></zn-stat> </zn-panel> </zn-cols>
Tile
Use layout="tile" for a self-contained stat card: the caption, the amount, a footer with the
delta and description, and an optional sparkline from comma-separated
spark values. Colour the sparkline with spark-color (a tone such as
success or danger, or any CSS colour). Set invert-delta where a rise
is bad news.
<zn-cols layout="1,1,1"> <zn-stat layout="tile" caption="Pending commission" amount="$2,941" show-delta previous="$2,875" description="vs. 1,875" spark="4,6,5,8,7,10,9,13,12,15"></zn-stat> <zn-stat layout="tile" caption="Unpaid paychecks" amount="$841" show-delta previous="$851" description="vs. 902" spark="12,11,13,10,9,10,8,9,7,6" spark-color="danger"></zn-stat> <zn-stat layout="tile" caption="Declined" amount="148" show-delta previous="140" invert-delta description="3.4% of orders" spark="6,5,7,4,6,5,5,4,6,5,4,5,4,5,4" spark-color="danger"></zn-stat> </zn-cols>
Selectable Tiles
Add selectable to make a tile a toggle button, for tiles that filter the content below them,
and tone for a coloured dot before the caption. selected sets the pressed state.
<zn-cols layout="1,1,1"> <zn-stat layout="tile" selectable tone="info" caption="Capturing payment" amount="28" description="Oldest 11 h" spark="0,0,1,0,2,1,0,3,2,4,3,5,8,12,28" spark-color="info"></zn-stat> <zn-stat layout="tile" selectable selected tone="warning" caption="Awaiting approval" amount="203" description="Oldest 29 days" spark="9,7,8,11,9,6,8,10,7,9,12,8,9,10,11" spark-color="warning"></zn-stat> <zn-stat layout="tile" selectable tone="success" caption="Complete" amount="3,481" show-delta previous="3,513" description="80% of orders" spark="120,128,119,124,118,131,127,122,126,130" spark-color="success"></zn-stat> </zn-cols>
Icon
Use icon to show an icon beside the amount. It takes the amount’s color unless you set
icon-color.
<zn-cols> <zn-panel> <zn-stat caption="Awards" description="This quarter" amount="12" icon="award@lu" color="warning"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Kudos" description="From reviewers" amount="2" icon="award@lu" icon-color="warning" color="neutral"></zn-stat> </zn-panel> </zn-cols>
Color Variants
Use the color attribute to set the semantic color of the stat. Available colors:
primary, error, info, warning, success, and
neutral.
<zn-cols> <zn-panel> <zn-stat caption="Active" description="Status" amount="99.8" type="percent" color="primary"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Critical Errors" description="Last hour" amount="3" color="error"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Notifications" description="Unread" amount="24" color="info"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Warnings" description="System alerts" amount="7" color="warning"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Completed" description="Tasks today" amount="42" color="success"></zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Pending" description="In queue" amount="156" color="neutral"></zn-stat> </zn-panel> </zn-cols>
Dashboard KPIs
A common use case is displaying multiple KPIs in a dashboard layout.
<zn-cols> <zn-panel> <zn-stat caption="Total Revenue" description="All time" amount="2847500" previous="2650000" currency="$" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Active Customers" description="Current subscribers" amount="4582" previous="4201" show-delta color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Avg Order Value" description="Last 30 days" amount="127.50" previous="115.80" currency="$" show-delta color="primary"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Satisfaction Rate" description="Customer feedback" amount="94.7" previous="92.3" type="percent" show-delta color="success"> </zn-stat> </zn-panel> </zn-cols>
Sales Metrics
Display sales-related statistics with currency formatting.
<zn-cols> <zn-panel> <zn-stat caption="Today's Sales" description="Updated 5 min ago" amount="12450.75" currency="$" color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="This Week" description="7 day total" amount="84922" previous="78100" currency="$" show-delta color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="This Month" description="Month to date" amount="342678.50" previous="298450" currency="$" show-delta color="primary"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Annual Goal" description="78% complete" amount="3847250" currency="$" color="warning"> </zn-stat> </zn-panel> </zn-cols>
Performance Metrics
Track system or application performance indicators.
<zn-cols> <zn-panel> <zn-stat caption="Uptime" description="Last 30 days" amount="99.97" type="percent" color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="API Response" description="Average latency" amount="127" type="time" color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Error Rate" description="Last 24 hours" amount="0.08" previous="0.12" type="percent" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Queue Time" description="Processing delay" amount="43" previous="28" type="time" show-delta color="warning"> </zn-stat> </zn-panel> </zn-cols>
User Engagement
Display user-related metrics and engagement statistics.
<zn-cols> <zn-panel> <zn-stat caption="Page Views" description="Last 7 days" amount="847523" previous="792100" show-delta color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Unique Visitors" description="This week" amount="34782" previous="31245" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Avg. Session" description="User engagement" amount="342" previous="298" type="time" show-delta color="primary"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Return Rate" description="Returning users" amount="64.8" previous="62.1" type="percent" show-delta color="success"> </zn-stat> </zn-panel> </zn-cols>
E-commerce Dashboard
A complete e-commerce metrics dashboard.
<zn-cols> <zn-panel> <zn-stat caption="Orders Today" description="Real-time" amount="147" previous="132" show-delta color="primary"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Cart Abandonment" description="Last 24 hours" amount="28.4" previous="31.7" type="percent" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Inventory Value" description="Current stock" amount="487250" currency="$" color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Refund Rate" description="This month" amount="2.3" previous="1.8" type="percent" show-delta color="warning"> </zn-stat> </zn-panel> </zn-cols>
Financial Summary
Display financial metrics with appropriate formatting.
<zn-cols> <zn-panel> <zn-stat caption="Net Profit" description="Q4 2025" amount="847500.25" previous="792340.50" currency="$" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Operating Costs" description="This quarter" amount="234890" previous="248750" currency="$" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Profit Margin" description="After expenses" amount="28.4" previous="26.7" type="percent" show-delta color="primary"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Cash Flow" description="Monthly average" amount="142750" currency="$" color="info"> </zn-stat> </zn-panel> </zn-cols>
SaaS Metrics
Key metrics for SaaS businesses.
<zn-cols> <zn-panel> <zn-stat caption="MRR" description="Monthly recurring revenue" amount="284750" previous="267890" currency="$" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Churn Rate" description="Customer attrition" amount="3.2" previous="4.1" type="percent" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="CAC" description="Customer acquisition cost" amount="127.50" previous="142.80" currency="$" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="LTV:CAC" description="Lifetime value ratio" amount="4.8" previous="4.2" show-delta color="info"> </zn-stat> </zn-panel> </zn-cols>
Marketing Campaign
Track marketing campaign performance.
<zn-cols> <zn-panel> <zn-stat caption="Impressions" description="Campaign reach" amount="1847523" previous="1592340" show-delta color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Click Rate" description="CTR" amount="3.8" previous="2.9" type="percent" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Cost Per Click" description="Average CPC" amount="1.42" previous="1.68" currency="$" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="ROAS" description="Return on ad spend" amount="487" previous="412" type="percent" show-delta color="primary"> </zn-stat> </zn-panel> </zn-cols>
Support Dashboard
Display customer support metrics.
<zn-cols> <zn-panel> <zn-stat caption="Open Tickets" description="Requires attention" amount="47" previous="62" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Avg Response Time" description="First reply" amount="892" previous="1247" type="time" show-delta color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Resolution Rate" description="First contact" amount="78.4" previous="73.2" type="percent" show-delta color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Satisfaction" description="CSAT score" amount="94.7" previous="92.1" type="percent" show-delta color="success"> </zn-stat> </zn-panel> </zn-cols>
Status Overview
Simple status indicators without delta comparisons.
<zn-cols> <zn-panel> <zn-stat caption="System Status" description="All systems operational" amount="100" type="percent" color="success"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Active Sessions" description="Current users" amount="1847" color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Queue Length" description="Pending jobs" amount="23" color="warning"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Failed Jobs" description="Requires intervention" amount="2" color="error"> </zn-stat> </zn-panel> </zn-cols>
Large Numbers
Stats automatically format large numbers with currency symbols.
<zn-cols> <zn-panel> <zn-stat caption="Total Valuation" description="Company worth" amount="12500000" currency="$" color="primary"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Total Users" description="Platform wide" amount="8472831" color="info"> </zn-stat> </zn-panel> <zn-panel> <zn-stat caption="Transactions" description="All time" amount="24789532" color="success"> </zn-stat> </zn-panel> </zn-cols>
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/@kubex/zinc@2.0.37/dist/components/stat/stat.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.jsdelivr.net/npm/@kubex/zinc@2.0.37/dist/components/stat/stat.js';
To import this component using a bundler:
import '@kubex/zinc/dist/components/stat/stat.js';
Properties
| Name | Description | Reflects | Type | Default |
|---|---|---|---|---|
layout
|
value-first puts the amount under the caption with the description beneath it, and
tints the amount rather than the description with color. tile is a
self-contained card: caption, amount, a footer with the delta and description, an
optional sparkline, and the default slot beneath.
|
|
'default' | 'value-first' | 'tile'
|
'default'
|
spark
|
Comma-separated values drawn as a sparkline under a tile. |
string
|
''
|
|
sparkColor
spark-color
|
The sparkline’s colour: a tone (primary, info, success,
warning, danger, ai) or any CSS colour.
|
string
|
''
|
|
invertDelta
invert-delta
|
Treats a rise as bad news, so an increase is coloured as a loss (declines, refunds, failures). |
boolean
|
false
|
|
tone
|
A coloured dot before a tile’s caption. |
|
'' | 'info' | 'success' | 'warning' | 'danger' | 'neutral'
|
''
|
selectable
|
Renders a tile as a toggle button, for tiles that filter the content below them. |
boolean
|
false
|
|
selected
|
Whether a selectable tile is pressed, or a linked tile marks the view the page is
showing.
|
|
boolean
|
false
|
deltaFormat
delta-format
|
How show-delta compares with previous: the relative change, or the
difference in points.
|
'percent' | 'points'
|
'percent'
|
|
icon
|
An icon shown beside the amount. |
string
|
''
|
|
iconColor
icon-color
|
The icon’s color; without one it takes the amount’s. |
IconColor
|
- | |
size
|
large gives the amount more weight, for a summary row of a few headline figures. |
|
'medium' | 'large'
|
'medium'
|
padded
|
Pads the stat, for stats laid edge to edge in a flush container such as
zn-cols no-gap divide.
|
boolean
|
false
|
|
href
|
Makes the whole stat a link, marked with an arrow in its corner. |
string
|
- | |
dataUrl
data-url
|
JSON fetched once to fill the stat: any of caption, amount,
description, previous, spark and sparkColor. The
stat’s own attributes show until it loads.
|
string
|
''
|
|
loading
|
Shows a tile as a placeholder. Set while data-url loads; the sparkline
draws in once it clears.
|
|
boolean
|
false
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Learn more about attributes and properties.
Dependencies
This component automatically imports the following dependencies.
<zn-icon>