lantern

Data display

Stat cards

Compact summary metrics.

Compact summary metrics extracted from the data-table overview. Use stat_card/1 alone or compose a responsive group with stat_grid/1. Callers own calculations, formatting, trends, and navigation state.

Standalone metric

Without href the card is a non-interactive div; subtitle adds quiet context.

Queued jobs
18 4 require attention

Responsive grid

Cards share a minimum basis, wrap without caller breakpoints, and only become links when href is present.

Open orders
42
Shipped
128
Long value
pending-warehouse-confirmation-2026-07
Revenue
$12,482.19 Last 30 days

API reference

Props and slots, introspected from the component.

stat_card/1
Prop Type Default Description
class any nil Extra classes merged onto the card.
href string nil Optional LiveView navigation target.
icon string nil Optional host heroicon class shown by the label.
id string nil Stable DOM id for the card.
label* string — Short caption identifying the metric.
sparkline_label string nil Accessible name for an informative sparkline; without one, the sparkline is decorative.
sparkline_series list nil Optional numeric list rendered as a trend sparkline when no :sparkline slot is passed.
subtitle string nil Optional muted context below the value.
tone neutral | info | success | warning | danger | promo | nil Optional semantic tone for subtle card tinting and sparkline accent.
value* any — Primary metric value to display.
Slots
:sparkline Optional trend sparkline slot rendered with the metric.
stat_grid/1
Prop Type Default Description
class any nil Extra classes merged onto the grid.
Slots
:stat A summary metric card; provide its value with the :value attribute or inner content.