Ark Logo
Undefined
Components
Date picker

Date Picker

A component that allows users to select a date from a calendar.

You can explore the date-picker component in the following curated examples.

Anatomy

To set up the date picker correctly, you'll need to understand its anatomy and how we name its parts.

Each part includes a data-part attribute to help identify them in the DOM.

Examples

Learn how to use the DatePicker component in your project. Let's take a look at the most basic example

Range Selection

To create a Date Picker that allows a range selection, set the selectionMode prop to range.

Standalone Date Picker

In some cases, you might want to display a non-dismissible date picker. This can be achieved by setting the open prop to true and closeOnSelect prop to false.

Important to note that standalone date picker doesn't use the Portal, Positioner and Content components.

Using the Root Provider

The RootProvider component provides a context for the date-picker. It accepts the value of the useDate-picker hook. You can leverage it to access the component state and methods from outside the date-picker.

If you're using the RootProvider component, you don't need to use the Root component.

API Reference

Accessibility

Keyboard Support

KeyDescription
ArrowLeft
Moves focus to the previous day within the current week.
ArrowRight
Moves focus to the next day within the current week.
ArrowUp
Moves focus to the same day of the week in the previous week.
ArrowDown
Moves focus to the same day of the week in the next week.
Home
Moves focus to the first day of the current month.
End
Moves focus to the last day of the current month.
PageUp
Moves focus to the same day of the month in the previous month.
PageDown
Moves focus to the same day of the month in the next month.
Enter
Selects the focused date and closes the date picker.
Esc
Closes the date picker without selecting any date.