| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
Controlled
Manage the selected date value with controlled state.
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
Disabled
Disable the date picker to prevent user interaction.
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
Minimum and Maximum
Restrict date selection to a specific range using the min and max props with the parseDate helper function.
| 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 | 31 | 1 | 2 | 3 | 4 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
| 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 | 31 | 1 | 2 | 3 | 4 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
Range Selection
Enable range selection by setting selectionMode="range" on the root component. Pair with two inputs fields:
index={0}to represent the start dates.index={1}to represent the end dates.
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
Inline calendar
Display the calendar inline without a popover by adding the inline prop to the root component. When using inline mode, omit the Portal and Positioner components.
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
Month and Year Selection
Add MonthSelect and YearSelect components to provide selectors for quickly changing the month and year.
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
| 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 |
Jan | Feb | Mar | Apr |
May | Jun | Jul | Aug |
Sep | Oct | Nov | Dec |
2020 | 2021 | 2022 | 2023 |
2024 | 2025 | 2026 | 2027 |
2028 | 2029 | 2030 | 2031 |
API Reference
Root
| Property | Default | Type |
|---|---|---|
locale | "en-US" | string | undefinedThe locale (BCP 47 language tag) to use when formatting the date. |
translations | - | IntlTranslations | undefinedThe localized messages to use. |
ids | - | Partial<{ root: string; label: (index: number) => string; table: (id: string) => string; tableHeader: (id: string) => string; tableBody: (id: string) => string; tableRow: (id: string) => string; ... 11 more ...; positioner: string; }> | undefined The ids of the elements in the date picker. Useful for composition. |
name | - | string | undefinedThe `name` attribute of the input element. |
timeZone | "UTC" | string | undefinedThe time zone to use |
disabled | - | boolean | undefinedWhether the calendar is disabled. |
readOnly | - | boolean | undefinedWhether the calendar is read-only. |
outsideDaySelectable | false | boolean | undefinedWhether day outside the visible range can be selected. |
min | - | DateValue | undefinedThe minimum date that can be selected. |
max | - | DateValue | undefinedThe maximum date that can be selected. |
closeOnSelect | true | boolean | undefinedWhether the calendar should close after the date selection is complete. This is ignored when the selection mode is `multiple`. |
value | - | DateValue[] | undefinedThe controlled selected date(s). |
defaultValue | - | DateValue[] | undefinedThe initial selected date(s) when rendered. Use when you don't need to control the selected date(s) of the date picker. |
focusedValue | - | DateValue | undefinedThe controlled focused date. |
defaultFocusedValue | - | DateValue | undefinedThe initial focused date when rendered. Use when you don't need to control the focused date of the date picker. |
numOfMonths | - | number | undefinedThe number of months to display. |
startOfWeek | - | number | undefinedThe first day of the week. `0` - Sunday `1` - Monday `2` - Tuesday `3` - Wednesday `4` - Thursday `5` - Friday `6` - Saturday |
fixedWeeks | - | boolean | undefinedWhether the calendar should have a fixed number of weeks. This renders the calendar with 6 weeks instead of 5 or 6. |
onValueChange | - | ((details: ValueChangeDetails) => void) | undefinedFunction called when the value changes. |
onFocusChange | - | ((details: FocusChangeDetails) => void) | undefinedFunction called when the focused date changes. |
onViewChange | - | ((details: ViewChangeDetails) => void) | undefinedFunction called when the view changes. |
onOpenChange | - | ((details: OpenChangeDetails) => void) | undefinedFunction called when the calendar opens or closes. |
isDateUnavailable | - | ((date: DateValue, locale: string) => boolean) | undefinedReturns whether a date of the calendar is available. |
selectionMode | "single" | SelectionMode | undefinedThe selection mode of the calendar. - `single` - only one date can be selected - `multiple` - multiple dates can be selected - `range` - a range of dates can be selected |
format | - | ((date: DateValue, details: LocaleDetails) => string) | undefinedThe format of the date to display in the input. |
parse | - | ((value: string, details: LocaleDetails) => DateValue | undefined) | undefinedFunction to parse the date from the input back to a DateValue. |
placeholder | - | string | undefinedThe placeholder text to display in the input. |
view | - | DateView | undefinedThe view of the calendar |
defaultView | "day" | DateView | undefinedThe default view of the calendar |
minView | "day" | DateView | undefinedThe minimum view of the calendar |
maxView | "year" | DateView | undefinedThe maximum view of the calendar |
positioning | - | PositioningOptions | undefinedThe user provided options used to position the date picker content |
open | - | boolean | undefinedThe controlled open state of the date picker |
defaultOpen | - | boolean | undefinedThe initial open state of the date picker when rendered. Use when you don't need to control the open state of the date picker. |
inline | - | boolean | undefinedWhether to render the date picker inline |
dir | "ltr" | "ltr" | "rtl" | undefinedThe document's text/writing direction. |
getRootNode | - | (() => ShadowRoot | Node | Document) | undefinedA root node to correctly resolve document in custom environments. E.x.: Iframes, Electron. |
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
RootProvider
| Property | Default | Type |
|---|---|---|
value | - | DatePickerApi<PropTypes> |
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
RootContext
| Property | Default | Type |
|---|---|---|
children | - | (datePicker: DatePickerApi<PropTypes>) => ReactNode |
Label
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"label">) => Element) | undefinedRender the element yourself |
Control
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
PresetTrigger
| Property | Default | Type |
|---|---|---|
value | - | PresetTriggerValue |
element | - | ((attributes: HTMLAttributes<"button">) => Element) | undefinedRender the element yourself |
Input
| Property | Default | Type |
|---|---|---|
index | - | number | undefinedThe index of the input to focus. |
fixOnBlur | true | boolean | undefinedWhether to fix the input value on blur. |
element | - | ((attributes: HTMLAttributes<"input">) => Element) | undefinedRender the element yourself |
Trigger
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"button">) => Element) | undefinedRender the element yourself |
Positioner
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
Content
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
YearSelect
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"select">) => Element) | undefinedRender the element yourself |
MonthSelect
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"select">) => Element) | undefinedRender the element yourself |
View
| Property | Default | Type |
|---|---|---|
view | - | DateView | undefined |
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
ViewControl
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
PrevTrigger
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"button">) => Element) | undefinedRender the element yourself |
ViewTrigger
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"button">) => Element) | undefinedRender the element yourself |
RangeText
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
NextTrigger
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"button">) => Element) | undefinedRender the element yourself |
Table
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"table">) => Element) | undefinedRender the element yourself |
TableHead
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"thead">) => Element) | undefinedRender the element yourself |
TableRow
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"tr">) => Element) | undefinedRender the element yourself |
TableHeader
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"th">) => Element) | undefinedRender the element yourself |
TableBody
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"tbody">) => Element) | undefinedRender the element yourself |
TableCell
| Property | Default | Type |
|---|---|---|
disabled | - | boolean | undefined |
value | - | number | DateValue |
columns | - | number | undefined |
visibleRange | - | VisibleRange | undefined |
element | - | ((attributes: HTMLAttributes<"td">) => Element) | undefinedRender the element yourself |
TableCellTrigger
| Property | Default | Type |
|---|---|---|
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |