...
The months displayed in the menu can be changed independently.
The user cannot select a To (end) date which is earlier than the selected From (start) date, or a From (start) date which is later than the selected To (end) date.
The range picker field will be updated in response to selections made in the range picker menu.
When 2 consecutive months are displayed together on the menu, the arrows are disabled accordingly, so that the From month cannot be moved forward and the To month cannot be moved backward:
...
Options should be disabled in the month and year drop-down selectors to prevent a From date which is later than the To date. For example, if the From date is set to 2021, then 2020 and earlier will be disabled in the To date drop-down.
The two date inputs in the range picker field can always be directly edited, with no need to use the range picker menu.
Clicking either the From or To fields or the date picker icon will open the range picker menu with the relevant date selected (either From or To).
Clicking the date picker icon is equivalent to clicking on the From date.
States
Date input field
State | Visual |
---|---|
Regular | |
Hover | |
Active | |
Disabled | |
Read-Only |
Error | |
Warning | |
Focused | |
Focused, Hover | |
Focused, Active | |
Focused, Disabled |
Interaction
1. Clicking on the From field.
...
|
2. Selecting the From date.
| |
|
3. Selecting the To date
|
Directly editing an existing range.
|
Selecting a date that is earlier than the selected From date.
| |
|
Validations and errors
Validation is displayed across the entire component.
Error | In the example, the From date is later than the To date (manually entered). | |
---|---|---|
Warning |
Transitions
The Range picker menu should slide up and down.
...
when a default set of ranges is pre-defined → a Selector can be a better approach for offering different periods.
...
Zeplin link | Screen thumbnail |
---|---|
Code
...