Datepickers

The Date Picker component lets users select a date.

Please select a date

Variations

Basic Datepicker Input

Base Size:

copydone
Please select a date
copydone
Select a date between 2020 and 2023
copydone

Large Size:

copydone
Please select a date
copydone
Select a date between 2020 and 2023
copydone

Outline Datepicker Input

Base Size:

copydone
Please select a date
copydone
Select a date between 2020 and 2023
copydone

Large Size:

copydone
Please select a date
copydone
Select a date between 2020 and 2023
copydone

Usage

Date pickers let people select a date. They should be suitable for the context in which they appear. Date pickers can be embedded into:

  • Dialogs
  • Forms

Specs

Datepickers fields come in two basic styles (base and outlined) and 2 sizes:

  • Base: text font size of 0.875rem (14px) and a label that scales from 0.875rem (14px) in font size, when the input is empty or 0.75rem (12px) when the label is floated. Helper text is also 0.75rem (12px) and a top and bottom margin of 1.5rem (24px) is used to house both the floating label and the helper text.
  • Large: text font size of 1rem (16px) and a label that scales from 1rem (16px) in font size, when the input is empty or 0.75rem (12px) when the label is floated. Helper text is also 0.75rem (12px) and a top and bottom margin of 1.5rem (24px) is used to house both the floating label and the helper text.

Accessibility notes

Date Pickers are built with the native <input type="date"> element and no additional accessibility roles are required. For better accessibility when using the element:

  • An id attribute to allow the date <input> to be associated with a <label> element for accessibility purposes.
  • A name attribute to set the name of the associated data point submitted to the server when the form is submitted.