EN
Getting started
16 · Cards

Stat cards

Highlights a single number with its label, an icon and its change from the previous period. Used side by side in dashboard summaries.

acun:stat-card
01

Basic usage

label and value are required. The value is written as is; if you need a thousands separator or a unit, pass the value already formatted.

LIVE EXAMPLE
<acun:stat-card label="Total customers" value="4,812" />
PropValues
labelDescription of the number
valueDisplayed value
02

Change

change shows the percentage change: 0 and above is drawn green with an up arrow, negative values red with a down arrow. The number is formatted for the application locale, with at most one decimal place; change-label adds a short description next to it.

LIVE EXAMPLE
<div class="grid gap-4 sm:grid-cols-3">
    <acun:stat-card label="Orders this month" value="3,106" :change="12.5" change-label="vs. last month" />
    <acun:stat-card label="Returns" value="214" :change="-4" change-label="vs. last month" />
    <acun:stat-card label="Open tickets" value="38" :change="0" />
</div>
PropValues
changePercentage; 0 and above green, negative red
change-labelText next to the change
03

Icon and colors

icon is shown in a colored box at the top left. The box color is chosen with color and defaults to brand; color affects only the icon box.

LIVE EXAMPLE
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-5">
    <acun:stat-card label="Total customers" value="4,812" icon="users" />
    <acun:stat-card label="Delivered" value="3,106" icon="truck" color="success" />
    <acun:stat-card label="Returns" value="214" icon="exclamation-triangle" color="warning" />
    <acun:stat-card label="Canceled" value="12" icon="x-circle" color="danger" />
    <acun:stat-card label="Open tickets" value="38" icon="ticket" color="info" />
</div>
PropValues
iconacun:icon name
colorbrand | success | warning | danger | info
04

Extra content

The actions slot sits in the top-right corner of the card; its position is the same with or without an icon. The default slot is appended to the bottom of the card; use it for a progress bar or a small chart.

LIVE EXAMPLE
<acun:stat-card label="Monthly target" value="3,106 / 3,400" icon="flag">
    <acun:slot:actions>
        <acun:badge variant="info">September</acun:badge>
    </acun:slot:actions>
    <acun:progress :value="91" size="sm" label="91 percent of the monthly target" />
</acun:stat-card>
PropValues
actionsSlot; top right
default slotBottom of the card
API

Props and slots

The values the component accepts.

PropDefaultDescription
label — Required; description of the number
value — Required; displayed value
changenullPercentage change; red when negative
change-labelnullText next to the change
iconnullacun:icon name
colorprimaryprimary · secondary · success · danger · warning · info · dark (icon box; brand = primary)
Slots: actions (top right), default content (bottom of the card)
Acun UI · Stat cardsDetailed usage and examples