Component Date Range Picker

The date range picker is used to select date ranges. It includes a date picker with two inputs for the start and end dates, as well as a mobile version of the date picker.

CodeUsage

Example

Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
April 2025
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
May 2025
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
June 2025
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
July 2025
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

Props

AttrTypeDefaultDocs

end-date

string

''

This property sets the end date.

max-date

string

''

This property represents the maximum date that can be selected.

min-date

string

''

This property represents the minimum date that can be selected.

readonly

boolean

false

When set to true, this property sets the date range picker to read only.

start-date

string

''

This property sets the start date.

vertical

boolean

false

Switch the date range picker to vertical mode allowing users to navigate months vertically instead of horizontally.

Methods

NameReturnsDocs

reset

Promise<void>

This method resets the date range picker.

setFocus

Promise<void>

This method sets the focus onto the date range picker.

Events

EventDetailDocs

datesChanged

any

This event is emitted whenever new dates are selected.

Anatomy

Date picker

An image of a date range picker in a popover and date picker input with components labeled as written below. An image of a date range picker in a popover and date picker input with components labeled as written below.
  1. Date picker: The calendar used to pick a date.
  2. Date picker input: An input used to collect and display a date selection.
  3. Month label: Shows the active month and year.
  4. Day label: Labels the day of the week for a column in the calendar.
  5. Navigation button: Toggles between months.
  6. Selection indicator: Shows which date has been selected.
  7. Date button: A clickable representation of dates in a month.
  8. Popover: A common collapsible container for date picker components

Date range picker

An image of a date range picker in a popover and date picker input with components labeled as written below.

The date range picker shares most of the same components as a date picker with the addition of the following:

  1. Date range picker: A calendar used to select a date range.
  2. Date range start: The first selected date in a date range.
  3. Date range end: The last date selected in a date range.
  4. Range selection indicator: Shows selected dates between a start and end date.

Calendar

Date picker calendars allow users to select a date contextually. For single date selections, one calendar is used. For selections of date ranges, two calendars may be visible in case a selection crosses into a second month.

An image of a date picker calendar showing two months – August and September of 2025.

A date picker calendar with two months shown at once.

Date picker input

The date picker input component is an input with an appended calendar icon. When focused, the date picker input opens a popover containing a date picker or a date range picker.

An image of a focused date picker input with an open date picker popover showing the month of March 2025.

A focused date picker input with an open date picker popover.

Input tooltips

Add a tooltip by setting the tooltip attribute to the desired text. Use tooltips sparingly, and keep text brief and supplementary. Do not include interactive elements. The tooltip appears on hover or keyboard focus.

Format must be in MM/DD/YYYY.
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sun
Mon
Tue
Wed
Thu
Fri
Sat
March 1984
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
April 1984
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
May 1984
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
June 1984
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Containers

While not required, date pickers are usually placed inside containers such as popovers. This allows calendars to be separated from other content to avoid confusion or be collapsed and nested, so they are out of the way until needed.

An image of a date picker inside a popover triggered by a date picker input within a form.
An image of a date picker improperly separated from it’s control. Both the input and the calendar are placed in their own cards with no visual relationship, which confuses users.
Do nest date pickers inside popovers to conserve space.
Don’t visually separate a date picker from its control.

How to use

Use a date picker:

  • For scheduling purposes
  • If it would be helpful for the date to be shown in context, such as in relation to the day of the week or proximity to the current date
  • If the date being selected occurred recently or is in the near future

Use a date range picker if one or all the above conditions are met, but a user needs to select a range between two dates rather than a single date.

Date pickers use the standard American date format: MM/DD/YYYY. Since our audience is primarily people living within the U.S., this should not be changed.

Users should always be allowed to type in their desired date or date range manually, so be sure that the date picker is not the only way a user can input a date.

Don't rely exclusively on date pickers when collecting distant dates such as birthdays. It is frustrating for users to have to scroll to their birth year.

An image of a date picker input receiving focus by the user’s cursor. The user has partially typed a date inside the input.
An image of a date picker without an input to type a date. The user has navigated to March 1995 by repeatedly clicking the previous month navigation button, which is a bad user experience.
Do allow users to manually type dates into a field.
Don’t force users to scroll for a long time to find a date in the distant past.

Behavior

Date pickers show the current month by default and, in the case of a multi-month date picker or a date range picker, will show the next month as well. Date pickers allow users to navigate between months and select dates, but it’s best to not use them for dates far into the future or long since past, such as birthdays. An input should be provided in these cases instead.

An image showing all the selection states for the day buttons in date and date range pickers as listed below.

Unselected and selected date selection states. Note: Dates between the start and end date in a range selection are also considered selected.

An image of the interactive states for date buttons, as listed below.
  • Default: The standard state of a date button.
  • Hover: When the cursor moves over a date without clicking it.
  • Focus: When a user highlights a date button with a keyboard. The focus state looks different when selected vs. unselected.
  • Disabled: A date that falls before a minimum date or after a maximum date.

Modifiers

Minimum and maximum dates can be used to limit possible user selections. Once set, only dates set after the min and before the max date will be selectable. All dates which fall outside of this range will be disabled.

For example, if a user is trying to schedule an appointment, a minimum date of “today” will prevent invalid appointments. Similarly, if an action has a deadline, a max date will prevent users from selecting a date beyond the deadline.

An image of a date picker with a min date set. A cursor is hovering a disabled date button, which has changed to reflect the disabled status.
An image of a date picker with an invalid date selection showing an error state.
Use relevant minimum and maximum dates to make selection easier.
Don’t allow users to make invalid selections, such as a future date when requesting a past date.

Date picker interactions

Mouse

  • Clicking the calendar navigation arrows will change the visible month.
  • Clicking a date button will select or deselect a date.
  • Clicking a different date will change the selection.

Keyboard focus

  • The tab key focuses into the date picker, beginning on the first month navigation button. Tabbing again will jump to the next month navigation button. Using an arrow key enters the calendar.
  • Arrow keys navigate between dates in the calendar.
  • Enter or space selects/deselects a date.
  • Tab or Esc exits the calendar.

Date range picker interactions

Mouse

  • Clicking into the input activates the cursor and allows typing.
  • The date picker popover also opens for users.
  • Clicking outside closes the date picker popover and removes focus from the input.

Keyboard focus

  • Tabbing to the input focuses on the input and allows text entry.
  • Pressing the down arrow key opens the date picker popover. The date picker can be navigated as described above.

Layout

Date picker and date range picker size

The height and width of a date picker and date range picker is set by default. If there is not enough room for both calendars in date range picker, only one is shown.

An image of a date picker with two visible calendars inside a container. The second container does not fit and overlaps the boundary of the container. This overlap is highlighted in red.
Don’t display more than one calendar if there is insufficient space to do so.

Date picker input size

The size of a date picker input is determined just like a standard input. On mobile devices, date pickers inside popovers grow to the full width of the screen.

Inline vs. nested

Date pickers can be placed inline or nested inside of popovers.

  • When used inline, follow the standard rules for designing forms.
  • Do not place separate date pickers next to one another horizontally, as this might confuse users.
  • When nested inside a popover, place the control in accordance with rules for designing forms. The popover will open on top of other content where it has room.
An image of two different date pickers placed horizontally next to one another. There is insufficient visual distinction between the two, and a user may not realize that they are separate from one another.
Don’t place unrelated date pickers next to one another inline.
Get in touch

Do you have an idea, or want to help us improve this page? Reach out to us via email.

DTMB-DG-Support@michigan.gov

Need help? Visit our Support page to learn how to get assistance, troubleshoot issues, and connect with the team.