Stat
Stat displays key metrics with a label, value, and optional trend indicator. Useful for dashboards and summary views.
Basic Usage
Total Revenue
$45,231
+12.5% from last month
import { Stat, StatLabel, StatValue, StatHelpText } from "@paramanu/data-display-react"
export default function App() {return ( <Stat> <StatLabel>Total Revenue</StatLabel> <StatValue>$45,231</StatValue> <StatHelpText trend="up">+12.5% from last month</StatHelpText> </Stat>)}<div class="pm-stat pm-stat--md pm-stat--start"><div class="pm-stat__label">Total Revenue</div><div class="pm-stat__value">$45,231</div><div class="pm-stat__help-text">+12.5% from last month</div></div>Accessibility
- Use meaningful label text for screen readers.
- Trend indicators should have text alternatives.
Best Practices
- Group related stats together in a dashboard layout.
- Use trend colors consistently: green for positive, red for negative.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | "md" | Font sizes and spacing |
align | "start" | "center" | "end" | "start" | Text alignment |
StatHelpText Props
| Prop | Type | Default | Description |
|---|---|---|---|
trend | "up" | "down" | - | Colors the text green (up) or red (down) |
CSS Classes
| Class | Description |
|---|---|
pm-stat | Base stat class |
pm-stat__label | Label text |
pm-stat__value | Primary value |
pm-stat__help-text | Help/trend text |