Stat
import { Stat, html } from '@shamar/core'
Stat.make('Unique views', '192.1k') .description('32k increase') .descriptionIcon('arrow-trending-up') .descriptionColor('success') .icon('eye') .color('success') .chart([7, 2, 10, 3, 15, 4, 17]) .chartColor('success') .url('/admin/analytics') .openUrlInNewTab() .extraAttributes({ 'wire:click': '…' }) .columnSpan(2)
Stat.make('Missing', null).placeholder('—')
Stat.configureUsing((stat) => { stat.placeholder('-')})
Stat.make('Rich', html('<em>1.2k</em>'))Methods
| Method | Description |
|---|---|
make(label, value) | Label/value; value may be null (uses placeholder). |
description / descriptionIcon / descriptionColor | Footer line + icon. |
icon / color / chart / chartColor | Card icon, accent, sparkline. |
url / openUrlInNewTab / extraAttributes | Clickable card. |
placeholder / columnSpan | Empty state and grid span. |
configureUsing | Global defaults for every Stat.make(). |
html() | Trusted HTML helper for label/value/description. |