Description

Date pickers allow the user to either select or manually enter a single date.

Usage & Behavior

General guidelines

Structure

Date pickers consist of:

States

Date input field

State

Visual

Regular

Regular.png

Hover

Hover.png

Active

Split Buttons Regular-Active.png

Disabled

Disabled.png

Read-Only

Read-Only.png

Error

Error.png

Warning

Warning.png

Focused

Focused.png

Focused, Hover

Focused, Hover.png

Focused, Active

Focused, Active.png

Focused, Disabled

Focused, Disabled.png

Calendar

State

Visual

General

Regular (x2 in size)

Hover (x2 in size)

Active (x2 in size)

Selected (x2 in size)

Disabled / Greyed out (x2 in size)

In case of greyed out the cursor will still be shown as a hand.

Today (x2 in size)

Internal logic

Interaction

The date can be set either via direct input or by using the controls in the calendar drop-down. Additional keyboard interaction can be found under the focus management section below.

Direct input

Date picker menu

Validation and Errors

Please refer to Field Validation page for more information.

A date field with a warning will have an orange border and a warning icon, as displayed below:

Date Picker Warning Validation.png

A date field with an error will have a red border and an error icon, as displayed below:

Date Picker Error Validation.png

Transitions

Best practices

Accessibility Compliance

Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.

Focus management

Keyboard

Date picker field

Date picker menu

Focused.pngSplit Buttons Regular-Active.png

Tab

  • Navigates the input section from left to right.

  • When on the last input section, the highlight will move to the next component.

Cycles through the different elements in the following order:

  • Left arrow.

  • Month menu.

  • Year menu.

  • Right arrow.

  • The focused day on the calendar. (By default, this is the current day).

Shift + Tab

  • Navigates the input section from right to left.

  • When on the first input section, the highlight will move to the previous component.

Reverses the order of navigation described for Tab.

Space

  • Opens the date picker menu.

  • Removes the section highlight.

  • When a day is highlighted - Sets the currently-selected date and closes the menu.

  • On month/year - Opens the menu.

  • On right/left arrows - Navigates between months accordingly.

Enter

Applies the date.

Sets the currently-selected date and closes the menu.

Esc

N/A

Closes the menu and returns the focus to the field, without applying any changes.

Arrows

  • Up - Increases the value of the highlighted input section.

  • Down - Decreases the value of the highlighted input section.

  • Right/Left - Moves the input highlight accordingly.

  • When a day is highlighted - All arrow keys (up, down, left, right) navigate between the days accordingly.

  • On the last day of the month - Right arrow key will navigate to the first day of the next month.

  • On the first day of the month - Left arrow key will navigate to the last day of the previous month.

  • On month/year - Down arrow key will open the menu.

Mouse

Date picker field

Date picker menu

Right click

Set Focus state on field

Set Regular state on component

Design

Zeplin Link

Thumbnail

https://zpl.io/aNXBPk2

Date Picker States.png

Code