Date dropdown - Usage

- Trigger button
- Datepicker
Date dropdowns combine a button showing the selected date or date range with a date picker in a dropdown. Use them in toolbars and filters, e.g. to select the time period of a report.
Options
- Value: Defines the selected date or date range. When no range is set, the button shows a placeholder text, by default "No range set".
- Single selection: By default, users select date ranges. Use single selection to allow selecting a single date.
- Predefined ranges: Offer frequently used ranges, e.g. "Last 7 days", next to the date picker for a faster selection.
- Format: Define the date format that determines how dates are displayed, e.g.
yyyy/LL/ddfor2024/06/15. See options here - Min and max dates: See date picker.
- Date picker appearance: See date picker.
- Week start: Define which day the week starts on.
- Week numbers: Show calendar weeks on the left side of the calendar when needed for reference.
- Button variant: See button.
- Require confirmation: Define if selected ranges are applied directly after date/date range selection or on selecting the confirm button.
Behavior in context
- Range selection: Users select a start date and then an end date. While only a start date is picked, the button label shows a trailing separator (e.g.
2024/06/15 -) to indicate that an end date is missing. - Applying a range: Without require confirmation, a complete range or a predefined range is applied immediately and the dropdown closes. With require confirmation, the selection is only applied when the confirm button is clicked.
- Closing without applying: Closing the dropdown with only a start date picked reverts to the previously applied range. With require confirmation, clicking the cancel button or outside the dropdown, or pressing the
Escapekey reverts any pending selections. Reopening the dropdown shows the previously applied range. - Confirm button: With require confirmation, the confirm button is disabled while the selection is incomplete (e.g. a range with only a start date) or unchanged from the applied range.
- Interaction: See date picker for keyboard navigation within the calendar.
Escapecloses the dropdown.
States
Date dropdowns have the same states as buttons. Calendar dates inside the dropdown follow the date picker states.

Dos and Don'ts
- Do use date dropdowns in toolbars and filters to select a date or time period
- Do offer predefined ranges for frequently used time periods
- Do use require confirmation when applying a range triggers time-consuming actions, e.g. reloading report data
- Do show the loading state while data for the selected range is loading
- Don't use date dropdowns in forms, use date inputs instead
- Don't overload the dropdown with too many predefined ranges