shadcn.io is not affiliated with official shadcn/ui
Month Calendar Blog Block for React
A recipe blog's month as a grid of day buttons, one small square per post on each day, and a panel that lists the posts of the chosen day.
Installation
Overview
A month calendar of posts for React with Base UI, written for the Larkspoon Diary, a recipe blog. A header sits over a split: at the start, May 2026 as a framed table of day buttons from Monday to Sunday, where each day with posts carries one small square per post; at the end, behind a divider that meets the top rule at a + mark, a panel for the chosen day. Choosing a day, with a click or the arrow keys, lists its posts there (category, title as a link, author and reading time) and a polite line says "May 12: 2 posts". A day with nothing says so. The month is fixed and every count is worked out from the typed posts. On a phone the panel sits under the grid. It's built from Badge and Guides, with a native table and buttons. For recipe diaries, event journals and any blog that publishes on a rhythm.
FAQ
How do I show a different month?
Change the constants at the top: LEAD (how many blank cells come before the 1st, with Monday first), DAYS, WEEKS, MONTH and the ISO prefix in FIRST_ISO, then give the posts dates in that month. The weekday of the 1st is fixed in the file rather than computed, so the grid is the same on the server and in every browser.
What do the squares mean?
One square for each post that ran that day, up to three. They are redundant with the text: every marked day also says "2 posts" to a screen reader, and the panel lists the posts. The chosen day turns into a solid cell.
How does it work with a keyboard?
The grid has one tab stop, the chosen day. Arrow keys move the choice and the focus by a day or a week and stop at the month's ends; Tab then leaves the grid for the panel's links. Each day is a button with aria-pressed, so a screen reader hears its date, how many posts and whether it is chosen. The table keeps dir="ltr" in a right-to-left page, so the arrow keys always follow the picture.
Related
- Pro
Nested Accordion Archive Blog
Archives by dateA farm journal's archive as a nested accordion, years that open to months and months that open to posts, with counts worked out from the posts and an Expand all control.
- Pro
Rail Timeline Blog
Archives by dateA local-history society's notebook as a vertical rail: a band per year, the year sticky at the rail's start, and dated entries hung off the rail on dots.
- Pro
Agenda Schedule Blog
Archives by dateA newsroom's upcoming posts as an agenda grouped by day, with a Select that shows every time in UTC, New York or Tokyo, in place.
- 1415161718Pro
Week Board Blog
Archives by dateA news digest's week as five columns, Monday to Friday, each with a huge day numeral and that day's posts or a quiet 'No post', in a snap scroller on phones.
- Pro
Ticket Stub Event Blog
Story formatsEvent announcements as ticket stubs: a date tile, a perforated edge, the title, the place, a seats bar and a Register link.
- Pro
Month Calendar Events About
Culture and valuesThe standing events of an event hosting company drawn as a month at a glance with no month name: a seven by five table of days with the recurring events marked by shape, and the same events as a dated agenda with a Subscribe link.