Date Input

Ready

A date input is a user interface element where the user can type or select a date in a predefined format.

Date input

Date input design specifications
Date input design specifications

The date input color, typography, border, spacing, width and margin specifications are inherited from the text input, for reference check the text input component documentation.

The date input doesn't have the following text input elements or properties, therefore, their listed styles don't apply:

  • Prefix / Suffix
  • The size small is not available

Datepicker dialog

Date specifications for picker
Structure and spacing for date picker calendar pop-up

States

Date input

States: enabled, hover, focus, error, and disabled.

Examples of date input states
Examples of date input states

Date dialog

States: enabled, hover, focus, and selected.

Examples of the calendar dialog states
Examples of the calendar dialog states

Anatomy

Component anatomy example
  1. 1.
    Label
  2. 2.
    Helper text (Optional)
  3. 3.
    Input container
  4. 4.
    Date button
  5. 5.
    Clear action
  6. 6.
    Error indicator
  7. 7.
    Error message
  8. 8.
    Placeholder / value

Design tokens

Color

Component tokenElementCore tokenValue
pickerBackgroundColorDialog containercolor-white#ffffff
pickerDayFontColorDialog textcolor-black#000000
pickerCurrentDateColorDialog titlecolor-grey-500#999999
pickerHoverDateBackgroundColorContainer backgroundcolor-purple-200#e5d5f6
pickerSelectedDateColorDate text:selectedcolor-white#ffffff
pickerSelectedDateBackgroundColorDate background:hovercolor-purple-700#5f249f
pickerHoverDateFontColorDate text:hovercolor-black#000000
pickerYearFontColorYear labelcolor-black#000000
pickerMonthFontColorMont labelcolor-black#000000
pickerWeekFontColorWeekday labelcolor-black#000000
pickerMonthArrowsBackgroundColorMonth selection controlscolor-transparenttransparent
pickerFocusColorFocus indicatorcolor-blue-600#0095ff

Typography

Component tokenElementCore tokenValue
pickerFontFamilyDatepicker dialogfont-family-sans`'Open Sans', sans-serif
PropertyElementCore tokenValue
font-sizeYear selectorfont-scale-031rem / 16px
font-sizeCurrent month-13px
font-sizeDay-13px
font-weightYear selectorfont-weight-semibold600
font-weightCurrent monthfont-weight-regular400
font-weightDayfont-weight-regular400

Spacing

PropertyElementCore tokenValue
paddingCalendar containerspacing-161rem / 16px
padding-left/rightMonth containerspacing-80.5rem / 8px
padding-left/rightYear selectorspacing-161rem / 16px
padding-top/bottomSeparatorspacing-80.5rem / 8px

Size

PropertyElementValue
height/widthSelected date circle28/28px
height/widthYear selection caret24/24px
height/widthCalendar top controls24/24px

Accessibility

WCAG 2.2

WAI-ARIA 1.2