Mini calendar
One week as a strip of day buttons, with the month above and buttons for the week before and after. Put it above a day's agenda or a booking list, where one day at a time is the job. For a whole month use the calendar.
Install
npx shadcn@latest add @thrum-pro/mini-calendarThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Automatically installs icons chevron-left and chevron-right from the icon set.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | null | – | The picked day, when the parent holds it. Use it with onValueChange. |
defaultValue | Date | null | Default null | The day picked at first, when the strip holds it itself. |
onValueChange | (value: Date) => void | – | Called with the day the visitor picks. |
min | Date | null | – | The earliest day that can be picked. The previous-week button stops at its week. |
max | Date | null | – | The latest day that can be picked. The next-week button stops at its week. |
weekStartsOn | 0 | 1 | 2 | 3 | 4 | 5 | 6 | – | The first day of the strip, 0 for Sunday. Defaults to the locale's week from the browser, else Monday. |
locale | string | Default "en-US" | The language of the month and weekday names. |
today | Date | – | The day marked as today, and the week shown first when nothing is picked. The strip never reads the clock. |
disabled | boolean | Default false | The whole strip is dimmed and cannot be changed or focused. |
sound | boolean | Default true | Play a click when a day is picked, if the visitor has sound on. |
className | string | – | Extra classes for the root. It fills its container; the days share the width. |
Motion and sound
Motion
- A new week slides in 16 pixels from the side it comes from and fades in over 200 ms.
- Nothing moves when the strip first appears.
- Reduced motion: the new week appears at once.
Sound
- A click when a day is picked. Turning the week is silent.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- It follows the WAI-ARIA grid pattern with one row: one tab stop, moved by the arrow keys.
- The row is named by the month above it, which is a polite live region, so the new month is read when the week turns into it.
- Each day is a button named by its full date. The picked day carries aria-selected and is filled; today carries aria-current and a dot.
- Days outside min and max keep their place in the arrow-key path, carry aria-disabled and are struck through.
- The strip needs 180 pixels, so that every day stays a 24 pixel target; a narrower container keeps that width. The weekday names shorten with an ellipsis.
| Keys | Action |
|---|---|
| Tab | Move onto the picked day, today or the first day of the week. Tab again moves to the week buttons. |
| ← / → | The previous or next day. Past either end of the week, the strip turns to the next week. |
| Home / End | The first or last day of the week. |
| Page Up / Page Down | The same weekday a week earlier or later. |
| Enter / Space | Pick the focused day. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/mini-calendar.tsx- Packages
- None
- Brings along
- CalendarIcon buttonSound engine
- Icons
chevron-leftchevron-right
Changelog
- 1.0.0 · 2026-12-03First release.