Components / Trend Chart
Trend Chart
A compact bar chart for count metrics over time (views, likes) inside a Card size sm. The header shows the series total; hovering a bar swaps it for that point.
import { TrendChart, type TrendDataPoint } from '@layers/ui/trend-chart'Rendered stock
House rules
- It renders its own Card size sm; drop it straight into a stats grid with no extra wrapper card.
- Pass raw numbers; the default formatter compacts them (4.2k, 1.5M). Override formatValue only for units the default cannot express.
- Use TrendChart for counts (bars) and RateChart for percentage rates (area).
- isLoading renders Skeletons in place of the value and chart; no hand-rolled loading states.