Skip to Content
Documentation
Getting startedComponentsChartsTheming
Get Pro
Overview
Concepts

Date Picker

Used to select dates or date ranges from a calendar.

Recipe

Anatomy

import { DatePicker } from '@chakra-ui/react'
<DatePicker.Root>
  <DatePicker.Label />
  <DatePicker.Control>
    <DatePicker.Input />
    <DatePicker.IndicatorGroup>
      <DatePicker.Trigger />
    </DatePicker.IndicatorGroup>
  </DatePicker.Control>
  <Portal>
    <DatePicker.Positioner>
      <DatePicker.Content>
        <DatePicker.View view="day">
          <DatePicker.Header />
          <DatePicker.DayTable />
        </DatePicker.View>
        <DatePicker.View view="month">
          <DatePicker.Header />
          <DatePicker.MonthTable />
        </DatePicker.View>
        <DatePicker.View view="year">
          <DatePicker.Header />
          <DatePicker.YearTable />
        </DatePicker.View>
      </DatePicker.Content>
    </DatePicker.Positioner>
  </Portal>
</DatePicker.Root>

Date values are represented by objects from @internationalized/date, which handle timezone-safe, locale-aware date math. The parseDate helper and the DateValue type are re-exported from @chakra-ui/react, so you don't need to install the package yourself.

import { parseDate } from '@chakra-ui/react'
import type { DateValue } from '@chakra-ui/react'

Examples

Basic

Compose DatePicker.Input with a DatePicker.Trigger to render a text input that opens a calendar popover.

Sizes

Use the size prop to change the size of the date picker.

Variants

Use the variant prop to change the visual style of the date picker.

Controlled

Use the value and onValueChange props to control the selected date. The value is always an array of DateValue objects, even in single selection mode.

Selected: 2026-01-26

Range Selection

Set the selectionMode prop to "range" to allow selecting a start and end date. Render two DatePicker.Input components and pass the index prop to bind each one to a side of the range.

Min and Max

Use the min and max props to restrict date selection to a specific range.

Clear Trigger

Use DatePicker.Context to swap the trigger for a DatePicker.ClearTrigger once a date has been selected.

Presets

Render the DatePicker.PresetTrigger component to provide quick date selection options like "Last 7 days" or "This month" next to the calendar.

Calendar

Set the inline prop on DatePicker.Root to render the calendar directly on the page, without the input, positioner and popup content. Use this when the calendar is the main interface, like a booking or scheduling view.

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

Inline calendars support every selection mode. Set selectionMode to "range" to let people pick a start and end date without opening a popup.

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

Date Input

Render only DatePicker.Control with a DatePicker.Input to get a date field without a calendar popup. Use this when people already know the date they want and typing it is faster than picking it, for example a date of birth.

Props

Root

PropDefaultType
closeOnSelect true
boolean

Whether the calendar should close after the date selection is complete. This is ignored when the selection mode is `multiple`.

defaultView '\'day\''
DateView

The default view of the calendar

hideMode ''display-none''
HideMode

How to hide content when mounted but not present. - `'display-none'`: HTML `hidden` attribute. Effects stay alive. - `'activity'`: React 19 `<Activity mode="hidden">`. Effects pause. Requires React 19+.

lazyMount false
boolean

Whether to enable lazy mounting

locale '\'en-US\''
string

The locale (BCP 47 language tag) to use when formatting the date.

maxView '\'year\''
DateView

The maximum view of the calendar

minView '\'day\''
DateView

The minimum view of the calendar

openOnClick false
boolean

Whether to open the calendar when the input is clicked.

outsideDaySelectable false
boolean

Whether day outside the visible range can be selected.

selectionMode '\'single\''
SelectionMode

The 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

skipAnimationOnMount false
boolean

Whether to allow the initial presence animation.

timeZone '\'UTC\''
string

The time zone to use

unmountOnExit false
boolean

Whether to unmount on exit.

colorPalette 'gray'
'base' | 'gray' | 'zinc' | 'neutral' | 'stone' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose' | 'sidebar' | 'sidebar.accent' | 'interaction' | 'accent' | 'presence' | 'status' | 'slate'

The color palette of the component

size 'md'
'xs' | 'sm' | 'md' | 'lg' | 'xl'

The size of the component

variant 'outline'
'outline' | 'subtle' | 'flushed'

The variant of the component

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
createCalendar
(identifier: CalendarIdentifier) => Calendar

A function that creates a Calendar object for a given calendar identifier. Enables non-Gregorian calendar support (Persian, Buddhist, Islamic, etc.) without bundling all calendars by default.

defaultFocusedValue
DateValue

The initial focused date when rendered. Use when you don't need to control the focused date of the date picker.

defaultOpen
boolean

The initial open state of the date picker when rendered. Use when you don't need to control the open state of the date picker.

defaultValue
DateValue[]

The initial selected date(s) when rendered. Use when you don't need to control the selected date(s) of the date picker.

disabled
boolean

Whether the calendar is disabled.

fixedWeeks
boolean

Whether the calendar should have a fixed number of weeks. This renders the calendar with 6 weeks instead of 5 or 6.

focusedValue
DateValue

The controlled focused date.

format
(date: DateValue, details: LocaleDetails) => string

The format of the date to display in the input.

id
string

The unique identifier of the machine.

ids
Partial<{ root: string; label: (index: number) => string; table: (id: string) => string; tableHeader: (id: string) => string; tableBody: (id: string) => string; tableRow: (id: string) => string; content: string; ... 10 more ...; positioner: string; }>

The ids of the elements in the date picker. Useful for composition.

immediate
boolean

Whether to synchronize the present change immediately or defer it to the next frame

inline
boolean

Whether to render the date picker inline

invalid
boolean

Whether the date picker is invalid

isDateUnavailable
(date: DateValue, locale: string) => boolean

Returns whether a date of the calendar is available.

max
DateValue

The maximum date that can be selected.

maxSelectedDates
number

The maximum number of dates that can be selected. This is only applicable when `selectionMode` is `multiple`.

min
DateValue

The minimum date that can be selected.

name
string

The `name` attribute of the input element.

numOfMonths
number

The number of months to display.

onExitComplete
VoidFunction

Function called when the animation ends in the closed state

onFocusChange
(details: FocusChangeDetails) => void

Function called when the focused date changes.

onOpenChange
(details: OpenChangeDetails) => void

Function called when the calendar opens or closes.

onValueChange
(details: ValueChangeDetails) => void

Function called when the value changes.

onViewChange
(details: ViewChangeDetails) => void

Function called when the view changes.

onVisibleRangeChange
(details: VisibleRangeChangeDetails) => void

Function called when the visible range changes.

open
boolean

The controlled open state of the date picker

parse
(value: string, details: LocaleDetails) => DateValue | undefined

Function to parse the date from the input back to a DateValue.

placeholder
string

The placeholder text to display in the input.

positioning
PositioningOptions

The user provided options used to position the date picker content

present
boolean

Whether the node is present (controlled by the user)

readOnly
boolean

Whether the calendar is read-only.

required
boolean

Whether the date picker is required

showWeekNumbers
boolean

Whether to show the week number column in the day view.

startOfWeek
number

The first day of the week. `0` - Sunday `1` - Monday `2` - Tuesday `3` - Wednesday `4` - Thursday `5` - Friday `6` - Saturday

translations
IntlTranslations

The localized messages to use.

value
DateValue[]

The controlled selected date(s).

view
DateView

The view of the calendar

hideOutsideDays
'true' | 'false'

The hideOutsideDays of the component

Input

PropDefaultType
fixOnBlur true
boolean

Whether to fix the input value on blur.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
index
number

The index of the input to focus.

View

PropDefaultType
view *
DateView

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.

TableCell

PropDefaultType
value *
number | DateValue

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
columns
number

disabled
boolean

visibleRange
VisibleRange

PresetTrigger

PropDefaultType
value *
PresetTriggerValue

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.