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.

Open Dropdown On Focus

To open the dropdown on focus, set openOnFocus 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 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

Currently, this section is being updated due to the migration of v2.