Skip to content
mdxcn is now part of Shadcn Labs. details

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.
instead
One month of marks is Calendar. Up or down days is Uptime.

written

`date: counts`. Counts run day by day from the date; `0*4` is four quiet days.

[ COMMITS ]
MWF

58 contributions

LessMore

58 contributions across 29 days
<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.

[ COMMITS ]
SepOctNovDecJanFebMarAprMayJunJulAugSep
MWF

774 contributions

LessMore

774 contributions across 371 days
: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.

[ SHIPPED ]
JunJulAug
MWF

Jun – Aug

LessMore

182 contributions across 91 days. Jun – Aug
: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"
/>
[ PROPS ]
PropTypeDefaultDescription
titlestring—Caption drawn on the top edge of the frame.
daysActivityDay[]—ISO date plus count. Gaps fill as empty days. Optional when children are Markdown.
childrenMarkdown—- 2026-03-02: 0 1 4 2 0*3 3
weekStartsOn0 | 100 is Sunday, like GitHub. 1 is Monday.
maxnumber—Lock the intensity scale. Defaults to the highest count.
legendbooleantrueLess / more glyph key under the grid.
captionstring | 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.
cornerstring"+"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.
classNamestring—Passed to the outer frame.