Table of Contents |
---|
...
Date input field. The date can be directly edited here, in the required format. If there is no default date, the input will show a hint text indicating the desired format (for example, dd/mm/yyyy).
Date picker button. A calendar Icon Button which opens the calendar drop-down.
Calendar drop-down, which consists of:
Month calendar, which allows the user to pick a specific date using mouse or keyboard input.
Month and Year selectors, which allow the user to directly select a specific month or year.
Left and Right arrows, which allow the user to navigate backward or forward one month at a time.
States
Date input field
State | Visual | |
---|---|---|
Regular | ||
Hover | ||
Active | ||
Disabled | ||
Read-Only | ||
Error | ||
Warning | ||
Focused | ||
Focused, Hover | ||
Focused, Active | ||
Focused, Disabled |
Calendar
The current day and the selected date are highlighted.
The calendar may contain dates which the user cannot select. Those dates should be disabled.
Days from the previous or next month, seen in the first or last weeks, should be greyed out (with the cursor still shown as a hand).
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
Unavailable days will be disabled.
...
Clicking on the calendar Icon Button or any blank space will open the date picker menu.
The date picker menu will be closed:
when a date is selected, or
by clicking outside the 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:
...
A date field with an error will have a red border and an error icon, as displayed below:
...
Transitions
A slide down transition is used when the menu opens.
A swipe transition is used when pressing the left and right arrows to navigate between the months.
...
Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.
Focus management
Keyboard | Date picker field | Date picker menu |
---|---|---|
Tab |
| Cycles through the different elements in the following order:
|
Shift + Tab |
| Reverses the order of navigation described for Tab. |
Space |
|
|
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 |
|
|
Mouse | Date picker field | Date picker menu |
---|---|---|
Right click | Set Focus state on field | Set Regular state on component |
Design
Zeplin Link | Thumbnail |
---|---|
Code
...