Skip to content

React Calendar

A glass React calendar built on Intl, so the week starts and the month names read the way the user's locale expects.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/calendar.json

Pick a check-in day

SunMonTueWedThuFriSat

No day picked yet

Single date

The selected-day pill glides to the new day; months slide in the direction you travel. Click the caption for the month and year grids.

SunMonTueWedThuFriSat

Saturday, November 7, 2026

Files to copy

5 folders · 9 files · 4 packages
From theme/src/
  • components/calendar/
  • hooks/{use-controllable.ts, use-direction.ts, use-latest.ts, use-media-query.ts, use-preferences.ts}
  • motion/tokens.ts
  • lib/{cn.ts, form.ts, warn-once.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/calendar.jsonRegistry item: calendar. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/glass-card/
  • motion/light-follower.ts
  • lib/heading.ts
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/glass-card.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Range, two months, unavailable days

Pick a start, then hover (or arrow) to preview the range; a range can't cross a booked day (every 9th and 10th here). Past days are off limits. Each caption opens the month grid for its own panel.

SunMonTueWedThuFriSat
SunMonTueWedThuFriSat

Nov 10 – 15, 2026

Locales

Same component, different locale: week start, names and digits all change. Arabic also runs right to left (arrow keys follow).

Locale
MonTueWedThuFriSatSun

Props

PropTypeDefaultDescription
aria-describedbystringNoneIds of elements that describe the field, merged with the control's own description and error ids.
aria-invalidboolean | "true" | "false"NoneMarks the field as invalid (also set automatically when error is shown).
onBlurFocusEventHandler<HTMLElement>NoneCalled when focus leaves the control (not when it moves between the control's own parts).
namestringNoneField name, used for native form submission and by form libraries.
localestringthe browser'sBCP 47 locale for names, digits and week start. When the page is prerendered or server-rendered, pass one (e.g. "en-US") so the HTML matches what the browser renders when it hydrates.
todayDatethe current dateWhat counts as "today" (the highlighted day, the default month, the Today shortcut).
weekStartsOnWeekdayNoneOverride the locale's first day of the week (0 = Sunday).
minDate | nullNoneThe earliest day that can be selected.
maxDate | nullNoneThe latest day that can be selected.
isDateDisabled((date: Date) => boolean)NoneMark days unavailable (still focusable, never selectable), e.g. weekends or booked days.
monthDateNoneSets the first visible month when controlled.
defaultMonthDatethe selection, or todayThe first visible month on mount (uncontrolled).
onMonthChange((month: Date) => void)NoneCalled with the first visible month when the person pages to another month.
numberOfMonthsnumber1Months shown side by side (they wrap on narrow screens).
showOutsideDaysbooleanonly with one monthShow the neighbouring months' days in the first and last rows.
fixedWeeksbooleantrueAlways 6 rows, so the height never jumps between months.
fluidbooleanfalseStretch to the container's width (cells share it) instead of a fixed cell size.
autoFocusbooleanfalseFocus the selected day (or today) on mount.
aria-labelstringNoneSets the accessible name of the whole calendar.
labelsPartial<CalendarLabels>defaultCalendarLabelsUI strings (translate these). Every other string, for translation: labels={{ previousMonth: "…" }}; omitted keys keep the English of defaultCalendarLabels. All 11 keys of CalendarLabels are listed in the key table under the props table.
classNamestringNoneAdds extra classes to the outer element.
mode (= "single")"single""single"Selection mode: one date at a time, so value is a single Date and clicking a day replaces it.
mode (= "range") (required)"range"NonePick a start and an end date.
value (mode = "single")Date | nullNoneThe selected date (controlled). null is no selection.
value (mode = "range")DateRangeNone{ start, end }. While picking, end is null.
defaultValue (mode = "single")Date | nullNoneThe selected date on mount (uncontrolled).
defaultValue (mode = "range")DateRangeNoneThe range on mount (uncontrolled).
onValueChange (mode = "single")(value: Date | null) => voidNoneCalled with the new date when one is picked.
onValueChange (mode = "range")(value: DateRange) => voidNoneCalled with { start, end } as the range is picked; end is null until the second click.
allowUnavailableInRange (mode = "range")booleanfalseLet a range span unavailable days.
CalendarLabels keys and English defaults (11)
Pass any key in labels; the rest keep the defaults of defaultCalendarLabels.
KeyEnglish default
previousMonthPrevious month
nextMonthNext month
previousYearPrevious year
nextYearNext year
previousYearsPrevious 12 years
nextYearsNext 12 years
chooseMonth(caption) => `${caption}, choose month and year`
chooseYear(year) => `${year}, choose year`
rangeStartstart of range
rangeEndend of range
monthChanged(caption) => caption

Keyboard

KeysAction
Arrow keysMove by one day (left, right) or one week (up, down); right-to-left flips left and right.
Home/EndJump to the start or end of the week.
Page Up/Page DownPrevious or next month.
Shift + Page Up/Page DownPrevious or next year.
Enter/SpaceSelect the focused day (in range mode, the first press sets the start and the second the end).

Accessibility

  • A WAI-ARIA date grid: role="grid" per month, one day in the tab order (roving tabindex), each day named with its full date.
  • Today, selected, range start and end, and unavailable days are all in the name. Unavailable days stay focusable but cannot be selected.
  • A polite live region announces month changes. Selection never relies on color alone.

When to use Calendar

  • Use it as an accessible calendar for a booking page where the month grid stays on screen, such as picking a check-in and check-out range for a rental, with range mode previewing the span as the pointer or keyboard focus moves.
  • Use it inside an admin scheduler or a reporting filter where people jump between months and years often, since the caption opens a month grid and then a year grid for long jumps.
  • Use it for a localized product: week start, month names, weekday names and even digits come from Intl, so locale="ar-EG" or "en-GB" needs no extra configuration or translation files for the grid itself.
  • Skip it when the calendar should hide behind a field in a compact form; DatePicker wraps the same grid in a popover on desktop and a bottom sheet on phones, so it fits better there.
  • Pair it with Popover to build your own trigger, with Field and Label for naming the grid in a form, and with Badge or Button to show the chosen range and a clear action beside it.

Frequently asked questions

67 components pages in all: browse them on All components.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .