activity
GraphActivity
A GitHub-style contribution grid. Pass dated counts, or write `- 2026-03-02: 0 1 4 2 0*3` and the counts fill in day by day from that date.
- use it
- Good for daily counts over months, like a contribution grid.
written
`date: counts`. Counts run day by day from the date; `0*4` is four quiet days.
58 contributions
LessMore
<GraphActivity title="COMMITS">
- 2026-03-02: 1 3 0 4 2 0*2 5 6 2 3 1 0*2 2 4 7 3 5 0*2 1 2 0 3 4 0*3
</GraphActivity>install
command
year
Dated counts. The grid, month labels, and intensity scale are derived.
774 contributions
LessMore
:root {
--graph-accent: oklch(0.5 0.14 228);
--graph-accent-2: oklch(0.48 0.18 259);
--graph-accent-3: oklch(0.5 0.14 248);
}
.dark {
--graph-accent: oklch(0.77 0.15 228);
--graph-accent-2: oklch(0.68 0.18 259);
--graph-accent-3: oklch(0.72 0.15 248);
}
import { GraphActivity } from "@/registry/default/graph-activity/graph-activity"
function activityDays(start: string, length: number) {
const [year, month, day] = start.split("-").map(Number)
const origin = Date.UTC(year, month - 1, day)
return Array.from({ length }, (_, index) => {
const time = origin + index * 86_400_000
const date = new Date(time).toISOString().slice(0, 10)
const dow = new Date(time).getUTCDay()
const week = Math.floor(index / 7)
let count = 0
if (dow > 0 && dow < 6) {
const pulse = (week + dow) % 9
count =
pulse === 0 ? 12 : pulse === 4 ? 7 : pulse % 3 === 0 ? 3 : index % 5 === 0 ? 1 : 0
} else if (index % 13 === 0) {
count = 2
}
return { date, count }
})
}
<GraphActivity
title="COMMITS"
days={activityDays("2025-09-01", 371)}
/>quarter
Shorter range. glyphs="ascii" swaps the block characters for .- =#@. activityDays is the helper from the example above.
Jun – Aug
LessMore
:root {
--graph-accent: oklch(0.5 0.14 228);
--graph-accent-2: oklch(0.48 0.18 259);
--graph-accent-3: oklch(0.5 0.14 248);
}
.dark {
--graph-accent: oklch(0.77 0.15 228);
--graph-accent-2: oklch(0.68 0.18 259);
--graph-accent-3: oklch(0.72 0.15 248);
}
import { GraphActivity } from "@/registry/default/graph-activity/graph-activity"
<GraphActivity
title="SHIPPED"
weekStartsOn={1}
glyphs="ascii"
days={activityDays("2026-06-01", 91)}
caption="Jun – Aug"
/>| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Caption drawn on the top edge of the frame. |
| days | ActivityDay[] | — | ISO date plus count. Gaps fill as empty days. Optional when children are Markdown. |
| children | Markdown | — | - 2026-03-02: 0 1 4 2 0*3 3 |
| weekStartsOn | 0 | 1 | 0 | 0 is Sunday, like GitHub. 1 is Monday. |
| max | number | — | Lock the intensity scale. Defaults to the highest count. |
| legend | boolean | true | Less / more glyph key under the grid. |
| caption | string | false | — | Replaces the computed contribution total. Pass false to hide it. |
| glyphs | "shade" | "ascii" | "hash" | "bar" | string[] | "shade" | Character set. shade is ·░▒▓█. ascii is .- =#@. Pass a preset or your own characters. |
| palette | "mono" | "duo" | "multi" | "mono" | mono is one accent plus muted. duo paints the second series with --graph-accent-2. multi cycles three accents. |
| corner | string | "+" | Character at each corner of the frame. |
| frame | "box" | "corners" | "rule" | "none" | "box" | box draws the dashed border. corners keeps only the corner marks. rule draws dashed lines above and below. none drops the border and padding, and puts the title above the content. |
| className | string | — | Passed to the outer frame. |