month grid
a month at a glance: a dot on the days that hold something, today's edge and the open day's bar. it sits in a reader's rail or beside any list of days.
bunx --bun shadcn@latest add @mk/month-gridserves orbit and artifacts.
example
the grid always prints six weeks from a monday, so a step never moves what sits under it. figures print in mono, so the columns hold. pick a day and its bar moves: nothing else does.
the marks
a dot says a day holds something. ink says what it holds and where it falls: foreground with something on it, muted when it’s empty or sits in the month beside it, faint when it’s both. today prints a 1 px edge and the open day a 2 px bar along its foot. they’re separate marks, so a day that is both prints both, and its aria label says selected because aria-current is already saying the date.
the week column
weeks, even an empty list, prints each week’s number under wk, in the same calendar weeks the year uses. a week in the list takes a dot and a link like a day does. without weeks there’s no column. a day with no link still prints its dot and says its label, and a month with no links reads as a table.
october 2026
| mo | tu | we | th | fr | sa | su |
|---|---|---|---|---|---|---|
october 2026
| mo | tu | we | th | fr | sa | su |
|---|---|---|---|---|---|---|
steps and keys
onMonthChange prints the two steps, and min and max bound them. at a bound a step keeps its place and its focus, and prints a faint arrow. the links are one tab stop: the open day, else today, else the first link, and it follows the keys. left and right walk the links in reading order, and past either end they turn the month and carry on from that date. up and down keep the column.
when the month that opens has no link past that date, focus moves to its step, or to the month’s nearest link if that step is closed. a step answers left and right too, so a month with no links still turns by key. while loading is set, focus waits on the step until the days arrive.
while the days are unread
an empty month and an unread month aren’t the same thing. loading holds the grid’s shape, marks where a dot could land and tells a screen reader the table is busy.
november 2026
| wk | mo | tu | we | th | fr | sa | su |
|---|---|---|---|---|---|---|---|
november 2026
| wk | mo | tu | we | th | fr | sa | su |
|---|---|---|---|---|---|---|---|
on a phone
every cell stands 44 px tall and every step reaches 44 px, each on its own box, so no two reaches overlap. with the week column the grid hangs 9 px into each side of a panel, which makes eight cells 44 px wide at 390 px. a narrower phone gives up width, about 40 px at 360.
parts
MonthGrid- the head and six weeks, from
month,today,days,weeks,loading,min,maxandonMonthChange. months and dates are plain, like2026-11and2026-11-03, anduseMinute’sdayis today. give it anaria-labelthat says what the month holds. MonthGridEntry- a day or a week with something in it: its
date, thelabelsaid before that date, andselected.hrefor a router link throughrendermakes it a link.