Calendar
Composable date picker with month grid, navigation, and year picker support built on React Aria Calendar
Import
import { Calendar } from "@thenamespace/uikit";Usage
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar} from "@thenamespace/uikit";
export function Basic() {Anatomy
import { Calendar } from "@thenamespace/uikit";
export default () => (
<Calendar aria-label="Event date">
<Calendar.Header>
<Calendar.Heading />
<Calendar.NavButton slot="previous" />
<Calendar.NavButton slot="next" />
</Calendar.Header>
<Calendar.Grid>
<Calendar.GridHeader>
{(day) => <Calendar.HeaderCell>{day}</Calendar.HeaderCell>}
</Calendar.GridHeader>
<Calendar.GridBody>
{(date) => <Calendar.Cell date={date} />}
</Calendar.GridBody>
</Calendar.Grid>
</Calendar>
);Year Picker
Calendar.YearPickerTrigger, Calendar.YearPickerGrid, and their body/cell subcomponents provide an integrated year navigation pattern.
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar} from "@thenamespace/uikit";
export function YearPicker() {Default Value
February 2025
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
"use client";
import {Calendar} from "@thenamespace/uikit";
import {parseDate} from "@internationalized/date";
Controlled
Use controlled value and focusedValue for external state coordination and custom shortcuts.
December 2025
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
30 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 1 | 2 | 3 |
"use client";
import type {CalendarDate} from "@internationalized/date";
import {Button, ButtonGroup, Calendar, Description} from "@thenamespace/uikit";Min and Max Dates
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar, Description} from "@thenamespace/uikit";
import {getLocalTimeZone, today} from "@internationalized/date";
Unavailable Dates
Use isDateUnavailable to block dates such as weekends, holidays, or booked slots.
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import type {DateValue} from "@internationalized/date";
import {Calendar, Description} from "@thenamespace/uikit";Weeks in Month
Set weeksInMonth to a fixed value (for example, 6) to keep the grid height stable when navigating between months. Use with care in non-Gregorian locales, similar to firstDayOfWeek.
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
"use client";
import {Calendar, Description} from "@thenamespace/uikit";
export function WeeksInMonth() {Week View
Set visibleDuration={{ weeks: n }} to show one or more weeks at a time. Navigation advances by the visible week range. Use pageBehavior="single" to move one week at a time when showing multiple weeks.
July 26 – August 1, 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar, Label, ListBox, Select} from "@thenamespace/uikit";
import {useState} from "react";
Day View
Set visibleDuration={{ days: n }} to show a rolling window of consecutive days. Navigation advances by the visible day range. Use pageBehavior="single" to move one day at a time when showing multiple days.
July 28 – August 1, 2026
| Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|
28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar, Label, ListBox, Select} from "@thenamespace/uikit";
import {useState} from "react";
Multiple Selection
Set selectionMode="multiple" to let users select several dates. value, defaultValue, and onChange use an array of dates.
January 1900
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
31 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 1 | 2 | 3 |
"use client";
import type {DateValue} from "@internationalized/date";
import {Calendar, Description} from "@thenamespace/uikit";Disabled
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar, Description} from "@thenamespace/uikit";
import {getLocalTimeZone, today} from "@internationalized/date";
Read Only
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar, Description} from "@thenamespace/uikit";
import {getLocalTimeZone, today} from "@internationalized/date";
Focused Value
Programmatically control which date is focused using focusedValue and onFocusChange.
June 2025
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
"use client";
import type {DateValue} from "@internationalized/date";
import {Button, Calendar, Description} from "@thenamespace/uikit";Cell Indicators
You can customize Calendar.Cell children and use Calendar.CellIndicator to display metadata like events.
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar} from "@thenamespace/uikit";
import {getLocalTimeZone, isToday} from "@internationalized/date";
Multiple Months
Render multiple grids with visibleDuration and offset for booking and planning experiences. Use Calendar.Heading with an offset (for example, offset={{ months: 1 }}) in each column header to label that month.
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
August 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
"use client";
import {Calendar} from "@thenamespace/uikit";
export function MultipleMonths() {International Calendars
By default, Calendar displays dates using the calendar system for the user's locale. You can override this by wrapping your Calendar with I18nProvider and setting the Unicode calendar locale extension.
The example below shows the Indian calendar system:
| रवि | सोम | मंगल | बुध | गुरु | शुक्र | शनि |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 31 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
"use client";
import {Calendar} from "@thenamespace/uikit";
import {getLocalTimeZone, today} from "@internationalized/date";
import {I18nProvider} from "react-aria-components";Note: The onChange event always returns a date in the same calendar system as the value or defaultValue (Gregorian if no value is provided), regardless of the displayed locale. This ensures your application logic works consistently with a single calendar system while still displaying dates in the user's preferred format.
Custom Navigation Icons
Pass children to Calendar.NavButton to replace the default chevron icons.
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar} from "@thenamespace/uikit";
export function CustomIcons() {Real-World Example
July 2026
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import type {CalendarDate, DateValue} from "@internationalized/date";
import {Button, Calendar} from "@thenamespace/uikit";Custom Styles
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 1 |
"use client";
import {Calendar} from "@thenamespace/uikit";
export function CustomStyles() {Styling
Passing Tailwind CSS classes
import { Calendar } from "@thenamespace/uikit";
function CustomCalendar() {
return (
<Calendar
aria-label="Custom calendar"
className="w-72 rounded-2xl border border-border bg-surface p-3 shadow-sm"
>
<Calendar.Header className="pb-3">
<Calendar.Heading className="text-default" />
<Calendar.NavButton slot="previous" className="text-default" />
<Calendar.NavButton slot="next" className="text-default" />
</Calendar.Header>
<Calendar.Grid>
<Calendar.GridHeader>
{(day) => <Calendar.HeaderCell>{day}</Calendar.HeaderCell>}
</Calendar.GridHeader>
<Calendar.GridBody>
{(date) => <Calendar.Cell date={date} />}
</Calendar.GridBody>
</Calendar.Grid>
</Calendar>
);
}Customizing the component classes
@layer components {
.calendar {
@apply w-72 rounded-2xl border border-border bg-surface p-3 shadow-sm;
}
.calendar__heading {
@apply text-sm font-semibold text-default-700;
}
.calendar__cell[data-selected="true"] {
@apply bg-accent text-accent-foreground;
}
}CSS Classes
Calendar uses these classes in packages/styles/components/calendar.css and packages/styles/components/calendar-year-picker.css:
.calendar- Root container..calendar__header- Header row containing nav buttons and heading..calendar__heading- Current month label..calendar__nav-button- Previous/next navigation controls..calendar__grid- Main day grid..calendar__grid-header- Weekday header row wrapper..calendar__grid-body- Date rows wrapper..calendar__header-cell- Weekday header cell..calendar__cell- Interactive day cell..calendar__cell-indicator- Dot indicator inside a day cell..calendar-year-picker__trigger- Year picker toggle button..calendar-year-picker__trigger-heading- Heading text inside year picker trigger..calendar-year-picker__trigger-indicator- Indicator icon inside year picker trigger..calendar-year-picker__year-grid- Overlay grid of selectable years..calendar-year-picker__year-cell- Individual year option.
Interactive States
Calendar supports both pseudo-classes and React Aria data attributes:
- Selected:
[data-selected="true"] - Today:
[data-today="true"] - Unavailable:
[data-unavailable="true"] - Outside month:
[data-outside-month="true"] - Hovered:
:hoveror[data-hovered="true"] - Pressed:
:activeor[data-pressed="true"] - Focus visible:
:focus-visibleor[data-focus-visible="true"] - Disabled:
:disabledor[data-disabled="true"]
API Reference
Calendar Props
Calendar inherits all props from React Aria Calendar.
| Prop | Type | Default | Description |
|---|---|---|---|
selectionMode | 'single' | 'multiple' | 'single' | Whether one or many dates can be selected. |
value | DateValue | null or DateValue[] | null | - | Controlled selected date(s). Use an array when selectionMode is multiple. |
defaultValue | DateValue | null or DateValue[] | null | - | Initial selected date(s) (uncontrolled). |
onChange | (value: DateValue | null) or (value: DateValue[] | null) => void | - | Called when selection changes. |
focusedValue | DateValue | - | Controlled focused date. |
onFocusChange | (value: DateValue) => void | - | Called when focus moves to another date. |
minValue | DateValue | Calendar-aware 1900-01-01 | Earliest selectable date. |
maxValue | DateValue | Calendar-aware 2099-12-31 | Latest selectable date. |
weeksInMonth | number | - | The number of weeks in a month. This overrides the default set by the locale. |
isDateUnavailable | (date: DateValue) => boolean | - | Marks dates as unavailable. |
firstDayOfWeek | 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | - | Overrides the locale default for the first day of the week. |
pageBehavior | 'visible' | 'single' | 'visible' | Whether paging advances by the visible duration or one unit at a time. |
selectionAlignment | 'start' | 'center' | 'end' | 'center' | Aligns the visible range to the selection on initial render. |
isDisabled | boolean | false | Disables interaction and selection. |
isReadOnly | boolean | false | Keeps content readable but prevents selection changes. |
isInvalid | boolean | false | Marks the calendar as invalid for validation UI. |
visibleDuration | {months?: number; weeks?: number; days?: number} | {months: 1} | Visible time range. Use { months: n } for month view, { weeks: n } for week view, or { days: n } for day view. |
defaultYearPickerOpen | boolean | false | Initial open state of internal year picker. |
isYearPickerOpen | boolean | - | Controlled year picker open state. |
onYearPickerOpenChange | (isOpen: boolean) => void | - | Called when year picker open state changes. |
Composition Parts
| Component | Description |
|---|---|
Calendar.Header | Header container for navigation and heading. |
Calendar.Heading | Formatted heading for the visible range. Supports offset (for multi-month layouts) and format (month/year/day options). |
Calendar.NavButton | Previous/next navigation control (slot=\"previous\" or slot=\"next\"). |
Calendar.Grid | Day grid for one month (offset supported for multi-month layouts). |
Calendar.GridHeader | Weekday header container. |
Calendar.GridBody | Date cell body container. |
Calendar.HeaderCell | Weekday label cell. |
Calendar.Cell | Individual date cell. |
Calendar.CellIndicator | Optional indicator element for custom metadata. |
Calendar.YearPickerTrigger | Trigger to toggle year-picker mode. |
Calendar.YearPickerTriggerHeading | Localized heading content inside the year-picker trigger. |
Calendar.YearPickerTriggerIndicator | Toggle icon inside the year-picker trigger. |
Calendar.YearPickerGrid | Overlay year selection grid container. |
Calendar.YearPickerGridBody | Body renderer for year grid cells. |
Calendar.YearPickerCell | Individual year option cell. |
Year Picker Parts
Year picker subcomponents inherit formatting props from React Aria useCalendarHeading and useCalendarYearPicker.
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Calendar.YearPickerTriggerHeading | format | DateFormatterOptions | - | Customize month/year label (e.g. {month: 'short'}). |
Calendar.YearPickerTriggerHeading | offset | {months?: number} | - | Shift the heading relative to the focused date (multi-month layouts). |
Calendar.YearPickerGrid | format | DateFormatterOptions | {year: 'numeric'} | Customize year cell labels (era, calendar system, etc.). |
Calendar.YearPickerGrid | visibleYears | number | min–max span or 20 | Number of years shown in the sliding window. Defaults to the full range between minValue and maxValue when both are set. |
Calendar.Cell Render Props
When Calendar.Cell children is a function, React Aria render props are available:
| Prop | Type | Description |
|---|---|---|
formattedDate | string | Localized day label for the cell. |
isSelected | boolean | Whether the date is selected. |
isUnavailable | boolean | Whether the date is unavailable. |
isDisabled | boolean | Whether the cell is disabled. |
isOutsideMonth | boolean | Whether the date belongs to adjacent month. |
For a complete list of supported calendar systems and their identifiers, see:
Related packages
@internationalized/date— date types (CalendarDate,CalendarDateTime,ZonedDateTime) and utilities used by all date componentsI18nProvider— override locale for a subtreeuseLocale— read the current locale and layout direction