Description

The range picker allows the user to set a customized range of dates using a unified component.

The range picker’s structure and behavior are based on the Date Picker, and are therefore are not repeated here.

Range Picker.png

Usage & Behavior

General guidelines

Structure

The range picker consists of:

Component

Image

Comments

Range picker field

A string indicating the range (From - To) and an icon button.

Next to the field, a preceding label can be set describing the purpose of the control.

Range picker menu

2 month calendars, displayed horizontally from left (start) to right (end). The direction of the dates might change according to RTL languages.

Internal Logic

Range Picker - From.pngRange Picker - To.pngRange Picker - Same month.png

States

Date input field

State

Visual

Regular

Range picker - Regular.png

Hover

Range picker - Hover.png

Active

Range picker - Active.png

Disabled

Range picker - Disabled.png

Read-Only

Range picker - Focused Read-Only.png

Error

Range picker - Error.png

Warning

Range picker - Warning.png

Focused

Range picker - Focused.png

Focused, Hover

Range picker - Focused Hover.png

Focused, Active

Range picker - Focused Active.png

Focused, Disabled

Range picker - Focused Disabled.png

Interaction

1. Clicking on the From field.

From.png

The menu is opened:

  • The From text is highlighted in the range picker field.

  • If one is already set, the From date is highlighted on the calendar.

  • Clicking outside of the control is equivalent to Cancel: the drop-down closes without applying any changes.

Range Picker - From.png

2. Selecting the From date.

  • The selected date is indicated on the calendar and in the range picker field.

  • The highlight automatically moves to the To field.

  • Clicking outside the menu closes the drop-down without applying any changes.

To.png
  • As the user hovers over another date, the dates between it and the selected From date should be highlighted. (The hover state is displayed only if the hovered date is later than the currently selected From date).

Range selecting.png

3. Selecting the To date

  • Clicking on a date which is later than or the same as the From date will:

    • close the calendar drop-down.

    • update the range picker field dates accordingly.

Range picker - Regular.png

  • Clicking on either the From or To fields will:

    • select the date within the range picker field, where it can be edited.

    • open the drop-down menu with the date highlighted.

Range Picker - Directly editing an existing range.png

  • The From field will be updated to the new date.

Range Picker - Selecting a date that is earlier than the selected From date.png
  • The To field will reset.

Range Picker - Selecting a date that is earlier than the selected From date 2.png

Validations and errors

Validation is displayed across the entire component.

Error

Range picker - Error.png

In the example, the From date is later than the To date (manually entered).

Warning

Range picker - Warning.png

Transitions

The Range picker menu should slide up and down.

Selecting the right and left arrows should swipe the dates horizontally. See the Date Picker for an example.

A swipe transition is used when pressing the left and right arrows to navigate between the months, as shown in the Date Picker.

Best practices

Use:

Don’t use:

General

Accessibility compliance

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

Design

Zeplin link

Screen thumbnail

https://zpl.io/2ErLpDv

Range Picker States.png

Code