DatePicker

DatePicker is a component used for users to select a date.

Usage

import { DatePicker } from "@yamada-ui/react"
<DatePicker />

Change Variant

Change Size

Change Color Scheme

Change Format

To change the format, set the format object.

Set Default Date

To set a default date, set defaultValue to a Date.

Set Default Input Value

To set a default input value, specify a string for defaultInputValue.

Set Default Month

To set a default month, set defaultMonth to a Date.

Set Minimum Date

To set the minimum selectable date, set minDate to a Date.

Set Maximum Date

To set the maximum selectable date, set maxDate to a Date.

Allow Values Outside Minimum and Maximum Range

By default, if a date outside the minimum and maximum range is entered, it is automatically replaced with the minimum or maximum date. To disable this control and allow values outside the range, set allowInputBeyond to true.

Disable Today Highlighting

To disable highlighting of today's date, set today to false.

Disable Specific Days of the Week

To disable specific days of the week, set excludeDate to a condition function.

Enable Multiple Selection

To enable multiple date selection, set multiple to true.

Set Maximum for Multiple Selection

To set the maximum number of selectable dates in multiple selection, set max to a number.

Change Separator

To change the separator, specify a string for separator. By default, , is set.

Enable Range Selection

To enable range selection, set range to true.

Change Start Day of Week

To change the start day of the week, set startDayOfWeek to "sunday" or "monday".

Change Weekend Days

To change which days are treated as weekends, set weekendDays to an array of days(numbers).

Set Pattern

To set a pattern, set a regular expression to pattern.

Handle Parsing of Entered Values

To handle the parsing of entered values, use parseDate.

Set Holidays

To set holidays, set holidays to an array of Dates.

Hide Outside the Current Month

To hide dates outside the current month, set styles using dayProps.

Change Offset

To change the offset, specify a value for gutter or offset.

Change Animation

To change the animation, specify "block-start" or "inline-end" for animationScheme. By default, "scale" is set.

Change Placement

To change the placement, specify "end" or "start-center" for placement. By default, "end-start" is set.

Blocking Scroll

To block scrolling, set blockScrollOnMount to true.

Close Dropdown On Scroll

To close the dropdown on scroll, set closeOnScroll to true.

Handle opening the dropdown on change

To handle the event of opening the dropdown on change, set a function to openOnChange.

Handle closing the dropdown on change

To handle the event of closing the dropdown on change, set a function to closeOnChange.

Disable Open Dropdown On Focus

To disable opening the dropdown on focus, set openOnFocus to false.

Disable Open Dropdown On Click

To disable opening the dropdown on click, set openOnClick to false.

Disable Focus After Clear

To disable focus after clear, set focusOnClear to false.

Disable Close On Select

To disable closing the dropdown on select, set closeOnSelect to false.

Disable Close On Outside Click

To disable closing dropdown when clicking outside, set closeOnBlur to false.

Disable Close On Esc

To disable closing the dropdown with the Esc key, set closeOnEsc to false.

Disable Clear Button

To disable the clear button, set clearable to false.

Disallow Input

To disallow input, set allowInput to false.

Change Shape

Disable

To disable, set disabled to true.

Read-Only

To make read-only, set readOnly to true.

Invalid

To make invalid, set invalid to true.

Change Border Color

To customize focus and error border colors, set colors for focusBorderColor or errorBorderColor.

Customize Icon

Customize Multiple Selection Display

Customize Calendar

You can customize Calendar to change the display.

Control

Props

Accessibility

The DatePicker follows the WAI-ARIA - Combobox Pattern for accessibility.

If you are not using Field.Root, set aria-label or aria-labelledby to DatePicker.

<DatePicker placeholder="YYYY/MM/DD" aria-label="Birthday" />
<VStack gap="sm">
  <Text as="h3" id="label">
    Birthday
  </Text>

  <DatePicker placeholder="YYYY/MM/DD" aria-labelledby="label" />
</VStack>

Keyboard Navigation

KeyDescriptionState
EnterWhen the input value is valid, applies it to the selection. Toggles the focused date if focus is in the calendar.-
BackspaceClears the last selection.-
EscapeCloses the calendar.closeOnEsc={true}
ArrowUpMoves focus to the date above if focus is in the calendar.-
ArrowDownMoves focus to the date below if focus is in the calendar.-
ArrowLeftMoves focus to the date to the left if focus is in the calendar. If it's the first date, moves to the last date of the previous month.-
ArrowRightMoves focus to the date to the right if focus is in the calendar. If it's the last date, moves to the first date of the next month.-
HomeMoves focus to the first date in the same week if focus is in the calendar.-
EndMoves focus to the last date in the same week if focus is in the calendar.-
PageUpMoves focus to the same date in the previous month if focus is in the calendar. If that date doesn't exist, moves to an enabled date in that month.-
Shift + PageUpMoves focus to the same date in the previous year if focus is in the calendar. If that date doesn't exist, moves to an enabled date in that month.-
PageDownMoves focus to the same date in the next month if focus is in the calendar. If that date doesn't exist, moves to an enabled date in that month.-
Shift + PageDownMoves focus to the same date in the next year if focus is in the calendar. If that date doesn't exist, moves to an enabled date in that month.-
SpaceToggles the selection state of the focused date if focus is in the calendar.-

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
DatePickerFieldrole="combobox"Indicates that it is a combobox.
aria-controlsWhen the calendar is open, sets the id of the associated DatePickerContent. When closed, sets undefined.
aria-disabledSets to "true" if disabled or readOnly is set.
aria-describedbyWhen DatePicker is within Field.Root and Field.Root has errorMessage or helperMessage, or Field.ErrorMessage or Field.HelperMessage is set, sets their id.
aria-expandedSets to "true" when the calendar is open, and "false" when it is closed.
aria-haspopup="dialog"Indicates that a dialog exists.
aria-invalidSets to "true" if invalid is set.
aria-readonlySets to "true" if readOnly is set.
aria-requiredSets to "true" if required is set.
DatePickerContentrole="dialog"Indicates that it is a dialog.
aria-hiddenWhen the calendar is open, sets to "false". When closed, sets to "true".
DatePickerIconrole="button"Indicates that it is a button when clearable and there is a value.
aria-disabledWhen clearable and there is a value, and disabled or readOnly is set, sets to "true".
aria-labelWhen clearable and there is a value, sets "Clear value".
Calendar.YearSelectaria-labelSets "Choose the year".
Calendar.MonthSelectaria-labelSets "Choose the month".
Calendar.Controlrole="status"Indicates that it is a status.
aria-live="polite"Indicates that it may be updated outside of focus.
Calendar.Monthrole="grid"Indicates that it is a grid.
aria-labelSets the displayed month and year, like "February 2026".
aria-multiselectableSets "true" if multiple selection or range selection is enabled.
Calendar.PrevButtonaria-labelSets "Go to the previous month".
Calendar.NextButtonaria-labelSets "Go to the next month".
CalendarDayaria-labelSets the date, like "Thursday, February 5, 2026". If today, sets "Today, Thursday, February 5, 2026".
aria-disabledSets "true" if the date is disabled.
aria-selectedSets "true" if the date is selected.