Skip to content
Haze UI

Mini calendar

A one-week strip of seven day radios with previous and next week buttons, for picking a day in tight spaces.

pnpm dlx shadcn@latest add @haze/mini-calendar
Open preview in a new tab
Livesmall script

When to use

  • The choice is a day in the next few days, such as a delivery date or a class, and a month grid is too big.
  • The picker sits in a narrow card, sidebar or mobile sheet and must fit 240 px.
  • The chosen day must submit with a plain form under a name, like any radio group.

When not to use

  • The date can be months away or must be typed; use calendar or date-picker.
  • The choice is a time of day on one date; use time-slot-picker.

Installation

Add the Haze registry to components.json once, then install Mini calendar with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/mini-calendar
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
id*string–Unique id. Every radio id and the legend id are derived from it.
namestringidSubmitted field name.
legendstringPick a dayVisible question above the strip.
startstring2026-11-09Any ISO date in the week to show; the strip begins on weekStart.
valuestring–ISO date selected on load.
todaystring–ISO date marked with a dot and the word 'today' for screen readers. Never read from the clock.
weekStart0 | 11First day of the week, Sunday or Monday.
disabledstring[][]ISO dates that cannot be chosen.
localestringenBCP 47 locale for weekday names and dates, formatted in UTC.
requiredboolean–A day must be chosen before the form submits.
previousLabelstringPrevious weekAccessible name of the previous button.
nextLabelstringNext weekAccessible name of the next button.
todayLabelstringtodayWord added to today's cell name.
classstring–Classes for the fieldset.

Keyboard interactions

Tab
Move into the day group, onto the chosen day or the first enabled one.
Arrow keys
Move to the next or previous enabled day and select it.
Space
Select the focused day.
Enter or Space on a week button
Show the previous or next week.

Accessibility

  • Each day is a real radio inside a fieldset with a legend; its name is the full date, such as 'Thursday, November 12, today'.
  • Today is marked by a dot and the word in the accessible name, never by color alone. Disabled days are struck through.
  • The week buttons are hidden until the script runs, so without script the strip shows the week from 'start' and stays fully usable.
  • The date range above the strip is a polite live region, so paging is announced.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Mini calendar" with `npx shadcn@latest add @haze/mini-calendar`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import MiniCalendar from "@/components/haze/ui/mini-calendar.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/mini-calendar.md

  • Customize with real content

    Adapt the Haze mini-calendar ui for our product. Replace the demo values of these props with our real content: id, name, legend, start, value, today, weekStart, disabled, locale, required, previousLabel, nextLabel, todayLabel, class. Keep the layout, the heading level rules and these accessibility details: Each day is a real radio inside a fieldset with a legend; its name is the full date, such as 'Thursday, November 12, today'. Today is marked by a dot and the word in the accessible name, never by color alone. Disabled days are struck through. The week buttons are hidden until the script runs, so without script the strip shows the week from 'start' and stays fully usable. The date range above the strip is a polite live region, so paging is announced. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using mini-calendar, check it fits: use it when the choice is a day in the next few days, such as a delivery date or a class, and a month grid is too big.; the picker sits in a narrow card, sidebar or mobile sheet and must fit 240 px.; the chosen day must submit with a plain form under a name, like any radio group.. Avoid it when the date can be months away or must be typed; use calendar or date-picker.; the choice is a time of day on one date; use time-slot-picker.. Alternatives: @haze/calendar, @haze/date-picker, @haze/time-slot-picker.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog