Skip to content
Ballpoint

Hatch Grid

A year of days as hand-drawn squares, one column a week, shaded in five levels from an empty box to solid ink.

Only in Ballpoint

639 commits in 2026

Installation

pnpm dlx shadcn@latest add @ballpoint/hatch-grid

Usage

tsx
import { HatchGrid } from "@/components/ui/hatch-grid"

<HatchGrid
  data={days} // { date: "2026-01-01", count: 3 }[]
  today="2026-10-06"
  summary="1,203 commits in 2026"
/>

Examples

Your own levels and labels

Pass level per day to set the shading yourself, and label to write the hover line.

Several habits

The same half-year for three habits, each with its own unit and total.

Write a page248 since April
Draw something113 since April
Read in bed144 since April

API reference

data
{ date: string; count: number; level?: 0 | 1 | 2 | 3 | 4 }[]

One entry a day. Level is worked out from count when left out: none, then quarters of the busiest day.

today
string

Days after it are drawn dotted, still to come. Where the grid is wider than its box, it opens on this week.

unit
default "contribution"
string | [string, string]

What's counted, for the hover label ("3 commits on Oct 6th, 2026"). The plural adds an s; pass [one, many] when it doesn't.

label
(day) => string

What hovering a day says, in place of the unit's sentence. A function, so pass it from a client component.

summary
string

What the grid shows, for screen readers; to them it's one image.

Pen settings

The drawing also takes draw and speed, as props or from the nearest InkProvider. What each one does.