- Implementation
- Calendar Props
Live Component Playground
Common Examples
Date Format
TheCalendar component accepts ISO 8601 date strings for value and defaultValue. Prefer date-only strings (for example, "2025-07-02") for predictable calendar date selection.onSelection returns a full ISO datetime string with timezone offset (for example, “2025-07-02T00:00:00.000-07:00”), or undefined when the selection is cleared.Convert to a date-only string (for example, const dateOnly = value?.split("T")[0];) before passing the value to date fields or APIs that expect YYYY-MM-DD.Example with new Date()
Controlling calendar state
Uncontrolled calendars
By default, calendars handle their own state. Use thedefaultValue prop to set the initial value of an uncontrolled calendar.Controlled calendars
Use thevalue prop to manually control the state of a calendar.Selecting a date range
Calendar can also be used to select range of dates usingrange prop.Calendar focus
By default, the month of selected date or today is shown.Overriding calendar focus
In the example below,2024-07-07 is the selected date but June is showing on initial render because of focusedDate="2024-06-06".Calendar Timezone
By default, local browser timezone is used. To override local system timezone,defaultTimezone can be used.Scoping calendar dates
There are two different ways to limit the scope of selectable dates within a calendar.Min and Max
TheminDate and maxDate props can be used to scope the date range selection.Unavailable dates
You can also pass an array of dates to theunavailable.dates prop to disable selecting specific dates.