Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Month Range Calendar

A month calendar where the reader picks a start month and an end month, with the months between them filled.

Built on the headless Month Range Calendar.See its API in Docs

Rendered by React 19.3.1

month-range-calendar.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/month-range-calendar.json

It also adds utils, button, month-calendar. The app needs its setup first: Installation.

Usage

MonthRangeCalendar is the Month Calendar's markup on the range Root: the same buttons, heading, views, visibleYears, min, max, locale, buttonVariant and children. Its value is { start, end }, '2026-11' strings, or null, and onValueChange(value, eventDetails) reports a range once, on the second press, ordered. Between the two presses the months from the first one to the one under the pointer or the focus are previewed with a lighter band, and Escape drops the pending start. The keys and the announcements come from the headless Month Range Calendar.

import { MonthRangeCalendar } from '@/components/ui/month-range-calendar'

Examples

Default

A year with a quarter chosen.

Its preview and code are at the top of the page.

The first and the last month are filled with the primary color, joined by a muted band across the months between them, as on the Range Calendar. This item takes Base UI's component ID as its slug and imports the Month Calendar item's markup.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Month Range Calendar's API reference.