Components

BaseKpiCard

A KPI with its value, change, comparison and a sparkline, in stacked or inline layout.

components/ui/kpi-cards/BaseKpiCard.vue
View in the demo

Layouts

Balance
$48,250.50
Up+8.1%
vs previous week
Churn rate
2.4%
Down-0.6%
vs previous week

Churn uses intent: 'down-is-good' so a drop shows in green.

The card adapts to its own width, not the window's: the label takes up to two lines before it is cut, the value shrinks only when the card is too narrow for it, and below 220px the icon moves above the label so it gets the full width. Three cards in a row next to the open sidebar stay readable.

Balance
$48,250.50
Down-3.1%
vs previous month
Previous month$49,794.12
Balance
Balance
1,280
Up+4.2%
Balance
1,280
Up+4.2%
Balance
1,280
Up+4.2%

API

Props

Name
Type
Default
Description
label
required
string—What the figure measures.
layoutKpiCardLayout"stacked"stacked (chart under the value) or inline (chart beside it).
densityKpiCardDensity"comfortable"comfortable or compact.
valuestring | number | BaseFormattedValueProps—A number, a string or BaseFormattedValue props.
formatKpiValueFormat—number, currency, percent or duration.
iconstring—An icon tile next to the label.
chart-typeSparklineType | "none""area"area, line, column or none.
chart-colorstringCHART_SERIES_TOKENS[0]A chart token such as chart-2.
chart-curveSparklineCurve"smooth"smooth or straight.
previous-seriesnumber[]—The previous period, drawn in stone.
changeBaseTrendChipProps—{ value, unit?, intent? } for the trend chip.
comparison-labelstring—Text after the change, such as “vs previous week”.
previous-valuenumber—The previous figure, shown in the footer.
previous-labelstring—The label of the previous figure.
loadingbooleanfalseShows the skeleton.
featuredbooleanfalseA highlighted version for the main KPI.
seriesChartSeriesInput—The values of the sparkline.
categories(string | number)[]—Labels for the chart tooltip.

Slots

Name
Slot props
Description
#comparison—Replaces the change row.
#chart—Replaces the sparkline.
#default—Replaces the value.
#previous-label—Replaces the previous value label.

Figures use .kpi-value. Never pass hex colours: the chart takes the theme tokens.

© 2026 melsami UI.
Developer documentation for melsami UI.