Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

CalendarMonth

  • Stable
  • WCAG 2.2 evidence
  • RTL

A month calendar for picking a date or a date range: header with previous / next buttons and the localised month name, weekday row, and six weeks of CalendarDays. Built on React Aria Calendar / RangeCalendar and @internationalized/date: - Keyboard (WCAG 2.1.1): Tab reaches the buttons and the focused day; arrows move by day and week, Page Up / Page Down by month (with Shift by year), Home / End to the first and last day of the month, Enter or Space selects. RTL reverses the horizontal arrows, and the chevrons mirror. - Locale: month names, weekday names, first day of the week, digits and calendar system follow the provider locale. - Names and announcements (1.3.1, 4.1.2, 4.1.3): the grid is named by the visible month; each day by its full date; React Aria's live region announces the new month while paging and the selected date or range. - minValue / maxValue and isDisabled disable dates (not focusable); isDateUnavailable keeps dates focusable but not selectable (struck through). Figma has no date picker: compose CalendarMonth inside a Popover or Dialog with a date field for one. The Figma Month text is derived from the visible month (focusedValue / defaultFocusedValue control it). Consumer duties: time zone handling (today(getLocalTimeZone())), explaining why dates are unavailable, and a visible label for the field the calendar fills.

import { CalendarMonth } from "@nexera-ui/react";
Loading example…
8
examples
27
props
5
live controls
1
platform
8
WCAG criteria
4
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
selectionMode
errorMessage
isDisabled
isReadOnly
isInvalid
Generated code
import { CalendarMonth } from "@nexera-ui/react";

<CalendarMonth />

Examples 7

The same examples as Storybook, rendered live. Open Code to copy one.

Range

selectionMode="range": Enter (or a click) sets the start, a second one the end; the ends and middle use the Figma range states.

Loading example…

Limits and unavailable dates

minValue / maxValue disable dates (not focusable); isDateUnavailable keeps weekends focusable but not selectable (struck through). A range across unavailable dates is invalid and shows errorMessage.

Loading example…

Disabled

isDisabled: every date and both buttons are disabled.

Loading example…

German

German: month and weekday names, Monday first.

Loading example…

Right to left

Right-to-left (Arabic): Saturday first, Arabic digits, mirrored chevrons, and the arrow keys follow the reading direction.

Loading example…

Narrow container

In a narrow container the columns shrink (never below the 24 px target) instead of overflowing.

Loading example…

Custom grid

The RAC RangeCalendar composition this component wraps, for custom layouts (two months side by side, events).

Loading example…

Props 27

Press "Try it" on a card to load that prop into the playground.

27 props shown

selectionModeNexera
"single" | "range"

What the user selects: one date (single, React Aria Calendar) or a start and end date. Not a Figma property. Selects a start and an end date (React Aria RangeCalendar).

Default "single"
errorMessageNexera
ReactNode

Error text under the grid, shown with an icon while the calendar is invalid (isInvalid, or a range that contains unavailable dates). Linked to the grid by React Aria. Say what is wrong and how to fix it.

Default –
classNameNexera
string

Extra classes for the root, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style for the root.

Default –
isDateUnavailableReact Aria
((date: DateValue) => boolean) | ((date: DateValue, anchorDate: CalendarDate | null) => boolean)

Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. The second argument provides the current selection anchor date, if any. This can be used to adjust the available dates based on the user's first selected date.

Default –
minValueReact Aria
DateValue | null

The minimum allowed date that a user may select.

Default –
maxValueReact Aria
DateValue | null

The maximum allowed date that a user may select.

Default –
isDisabledReact Aria
boolean

Whether the calendar is disabled.

Default false
isReadOnlyReact Aria
boolean

Whether the calendar value is immutable.

Default false
autoFocusReact Aria
boolean

Whether to automatically focus the calendar when it mounts.

Default false
focusedValueReact Aria
DateValue | null

Controls the currently focused date within the calendar.

Default –
defaultFocusedValueReact Aria
DateValue | null

The date that is focused when the calendar first mounts (uncontrolled).

Default –
isInvalidReact Aria
boolean

Whether the current selection is invalid according to application logic.

Default –
pageBehaviorReact Aria
"single" | "visible"

Controls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration.

Default visible
firstDayOfWeekReact Aria
"sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat"

The day that starts the week.

Default –
selectionAlignmentReact Aria
"start" | "center" | "end"

Determines the alignment of the visible months on initial render based on the current selection or current date if there is no selection.

Default 'center'
weeksInMonthReact Aria
number

The number of weeks in a month. This overrides the default set by the locale.

Default –
valueReact Aria
DateValue | RangeValue<DateValue> | null

The current value (controlled).

Default –
defaultValueReact Aria
DateValue | RangeValue<DateValue> | null

The default value (uncontrolled).

Default –
onChangeReact Aria
((value: DateValue) => void) | ((value: RangeValue<DateValue>) => void)

Handler that is called when the value changes.

Default –
idReact Aria
string

The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).

Default –
aria-labelReact Aria
string

Defines a string value that labels the current element.

Default –
aria-labelledbyReact Aria
string

Identifies the element (or elements) that labels the current element.

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –
createCalendarReact Aria
((identifier: CalendarIdentifier) => Calendar) | ((identifier: CalendarIdentifier) => Calendar)

A function to create a new [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a given calendar identifier. If not provided, the createCalendar function from @internationalized/date will be used.

Default –
commitBehaviorReact Aria
"clear" | "reset" | "select"

Controls the behavior when a pointer is released outside the calendar or a blur occurs mid selection: - clear: clear the currently selected range of dates. - reset: reset the selection to the previously selected range of dates. - select: select the currently hovered range of dates.

Default 'select'
allowsNonContiguousRangesReact Aria
boolean

When combined with isDateUnavailable, determines whether non-contiguous ranges, i.e. ranges containing unavailable dates, may be selected.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

6 direct · 2 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.1Use of ColorLevel A · tested directly
  • 2.1.1KeyboardLevel A · tested directly
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 3.3.1Error IdentificationLevel A · tested directly
  • 4.1.2Name, Role, ValueLevel A · tested directly
  • 4.1.3Status MessagesLevel AA · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

Usage
<CalendarMonth className="shadow-sm" />

Used in blocks

Related components