活动统计

New

使用量统计组件族:用于关键指标的连体统计条、基于 color-mix 强度色阶与逐列级联淡入的 GitHub 风格贡献热力图,以及纯文本周期切换器。

0.00B
tokens
0M
peak
0h 0m
longest task
0
day streak
0
day best streak
Token activity
AugSepOctNovDecJanFebMarAprMayJunJul

安装

用 shadcn CLI 添加,或手动复制源码。

$ bunx --bun shadcn add @uilab/activity-stats

API 参考

StatsBar

className?
string

StatsItem

value
ReactNode

Typically an `AnimatedNumber`/`NumberTicker` node so it counts in on mount.

label
ReactNode
className?
string

ActivityHeatmap

data
number[]

Column-major cell values: index `week * 7 + day`, top to bottom then left to right. Shorter arrays are zero-padded up to `weeks * 7`.

weeks?
number
52
max?
number

Ceiling for the color scale; defaults to the highest value in `data`.

months?
{ label: string; week: number; }[]

Month-axis labels under the grid, `week` is the column index they sit above.

cellTitle?
((index: number, value: number) => string)

Native `title` tooltip text; defaults to the raw value.

className?
string

StatsPeriodTabs

options
{ value: string; label: ReactNode; }[]
value
string
onChange
(value: string) => void
className?
string

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.