# Pickers

{% embed url="<https://material.io/components/pickers/>" %}

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1g0a3EZETlsbQeARIJN_DYAiXo1DK8nC9%2Fpicker-intro.png" alt=""></div>

## Usage&#x20;

Date pickers let users select a date or range of dates. They should be suitable for the context in which they appear.

Date pickers can be embedded into:

* Dialogs on mobile
* Text field dropdowns on desktop

### Principles

#### Relevant

Date pickers can display past, present, or future dates – as relevant to the task.

#### Clear

Clearly indicate important dates, such as current and selected days.

#### Intuitive

To ensure picking a day or time is intuitive, use common picker patterns, such as a calendar.

## Anatomy&#x20;

### Mobile calendar date picker

1. Title
2. Selected date
3. Switch-to-keyboard input icon
4. Year selection menu
5. Month pagination
6. Current date
7. Selected date

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1pr_eakmp-QAODHh_VJTqFO8JcFWJWhaM%2Fpicker-elements-calendar.png" alt=""></div>

### Mobile date range picker

1. Title
2. Selected date range
3. Switch to keyboard input icon
4. Month and year label
5. Current date
6. Start date
7. Selected range
8. End date

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F13hURY0XomgSTbPkhzifBGMVVQGz8V7--%2Fpicker-elements-range.png" alt=""></div>

### Mobile input picker

1. Title
2. Selected date
3. Switch-to-calendar view icon
4. Text field

![](https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1iy-JbcnYcWwoeTu7l3nlR9frsKSJ_qiS%2Fpicker-elements-input.png)

### Desktop date picker

1. Text field
2. Year and month selection
3. Month pagination
4. Today’s date
5. Selected day
6. Hover state

![](https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-d0dJMFg2OTdGWjg%2Fpicker-elements-desktop.png)

###

## Mobile pickers

### Mobile calendar pickers

#### Usage

Mobile calendar pickers can be used to select dates in the near future or past, when it’s useful to see them in a calendar month format. They are displayed in a dialog.

Common use cases include:

* Making a restaurant reservation
* Scheduling a meeting

They aren’t ideal for selecting dates in the distant past or future that require more navigation, such as entering a birth date or expiration date.

Mobile calendar pickers allow selection of a single date and year.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1luixhoFfDSk7DCBpduAhfQ5IP1ojD8DI%2Fpicker-choosing-date-calendar.png" alt="Mobile calendar picker"></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1gNu5TU21eGLqyHK2RXJtUB21VFkp-P4Z%2Fpicker-date-mobile-composition.png" alt="【Do】Maintain 16dp left and right padding from the edge of the screen. The top and bottom of the picker should be vertically centered in the screen."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F18uXb1sijfKceLoG0VdMJoHmfPclgKd9w%2Fpicker-date-mobile-composition-dont.png" alt="【Don’t】Don’t use more than 16dp from the left and right screen edges, as it creates smaller touch targets."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1o6wh4a02ut0shZyuctSO3WgrqruS8uFm%2Fpicker-dob-dont.png" alt="【Don’t】Don’t use a calendar picker to prompt for dates in the distant past or future, such as a date of birth. In these cases, use a mobile input picker or a text field instead."></div>

#### Behavior

Mobile calendar pickers navigate across dates in several ways:

* To navigate across months, swipe horizontally
* To navigate across years, scroll vertically
* To access the year picker, tap the year

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1mgW61u324uiQap6ISSOyZo5xCBW9BFMO%2Fhorizontal-swipe.mp4>" %}
Horizontal swiping lets the user navigate across months.
{% endembed %}

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1XIALcbRFq7fpoFwbM8rVYm8l6eSQWMYj%2Fselect-year-baseline.mp4>" %}
Tapping the year menu accesses the year picker. Scrolling vertically navigates across years.
{% endembed %}

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1uzHSXNN_tcUSk-_qQNuDzSZOfS7Tw8G5%2Fpicker-date-mobile-horizontal-orientation.png" alt="Mobile calendar pickers adapt to a device’s orientation."></div>

### Mobile date range pickers

#### Usage

Mobile date range pickers allow selection of a range of dates. They cover the entire screen.

Common use cases include:

* Booking a flight
* Reserving a hotel

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1ngkWqYCRDQw3ErFqexDfiyoSYQXemrjj%2Fpicker-choosing-range.png" alt="Mobile date range picker"></div>

#### Behavior

Mobile date range pickers navigate across dates in several ways:

* To select a range of dates, tap the start and end dates on the calendar
* To navigate across months, scroll vertically

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1MFP4zycggnJ5wGvHeDbXPs8z_zYUi-YW%2Frange-select-select.mp4>" %}
Select a range of dates with the date range picker.
{% endembed %}

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1QHIiyyxx6Uq7AROnW2CnbL0lchys_GRz%2Frange-select-scroll.mp4>" %}
Scroll vertically to access different months.
{% endembed %}

### Mobile date input pickers

#### Usage

Mobile date input pickers allow the manual entry of dates using the numbers on a keyboard. Users can input a date or a range of dates in a dialog.

#### Mobile date input picker

Mobile date input pickers allow for keyboard input to select a date or range of dates.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1wNxz6MUqYsaFugCBe80ekoVz6m1XsS2K%2Fpicker-choosing-textfield.png" alt="Mobile date input picker"></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1W3l886iP3r9TzdvM_FZHSFoTHxgBxKQj%2Finput-do.png" alt="【Do】For dates that don’t require a calendar view, make the mobile date input picker as the default prompt."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1T2WFOq3etDuGsZ435G7zfhV5xhYzQAFD%2Finput-do-2.png" alt="【Do】Alternatively, a text field with appropriate hint text can prompt for dates, such as in a form."></div>

###

#### Behavior

The mobile date input picker can be accessed from any other mobile date picker, via the edit icon.

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1DZxYqXE6_Ube-OYBYInbBFtPwAk9P2el%2Finput-single.mp4>" %}
Switching from a mobile calendar picker to a mobile date input picker
{% endembed %}

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1tCjZSl8cfKsQeDgyeCd2Oo9Io8E1jigd%2Finput-range.mp4>" %}
Switching from a mobile date range picker to a mobile date input picker
{% endembed %}

## Desktop pickers&#x20;

### Desktop date pickers

#### Usage

Desktop date pickers allow the selection of a specific date and year. The desktop date picker displays a date input field by default, and a dropdown calendar appears when the user taps on the input field. The user can interact with either form of date entry.

Desktop date pickers are ideal for navigating dates in both the near future (or past) and the distant future (or past), as they provide multiple ways to select dates.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-NWVfejVvS3ltY0U%2Fpicker-desktop-intro.png" alt="Desktop date picker"></div>

### Behavior

Users can input dates either using a keyboard or by navigating the calendar UI; both options are immediately available when the desktop date picker is accessed.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-dHFYN1RNOEdIM2M%2Fpicker-choosing-singledate-desktop.png" alt="Desktop date picker"></div>

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1w0goLOoIj8ldqyuPC3OjWA8bGPHKxf8B%2Fpicker-desktop-next-month.mp4>" %}
Navigate through months by tapping the back and next arrows.
{% endembed %}

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F15qusPbF-nXXuggaAbSg5NsrXYd0gEbrU%2Fpicker-desktop-select-year.mp4>" %}
Navigate through years by tapping the dropdown.
{% endembed %}

### Desktop date range pickers

Desktop date range pickers allow a range of days to be selected. They display both calendar and date input fields.

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1ow2svD50eumJzHFJUZc4PLKZCAJJCYsX%2Fpicker-desktop-singledate-selectdate.mp4>" %}
Desktop date range pickers select ranges of dates. The text field reflects the calendar dates selected.
{% endembed %}

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-WTJQQlY3ZXNocHM%2Fpicker-choosing-daterange-desktop.png" alt="Desktop date range picker"></div>

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1EQJ82mhPkr68wM2kFwpDplTdtdBUkA7b%2Fpicker-desktop-singledate-hover-do.mp4>" %}
【Do】Use hover states to preview a user’s selection.
{% endembed %}

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1AEADUzU2gGj4ooW0_3-K-_bjGk11xNcx%2Fpicker-desktop-singledate-hover-dont.mp4>" %}
【Don’t】Don’t use the same style for hover and selected states.
{% endembed %}

Tooltips can help explain how to use date picker controls.

1. Tooltip used on month and year selector
2. Tooltip on day selector
3. Tooltip used on month pagination control
4. Tooltip used on selected date

![](https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-VkN4TG9Mdk9PRWc%2Fpicker-desktop-tooltips.png)
