Browse Components

Components

Datepicker

The datepicker component helps users pick dates from a calendar or type them directly into the input.

DesignUsageAccessibilityUpdates

Purpose

Select a date

The calendar view helps users choose dates with surrounding context.

Allow typing or picking

Users can enter a date in the input or choose one from the calendar.

Reduce date ambiguity

Use a shared date pattern so users know what format to enter.

Anatomy

1

Label

2

Value

3

Input container

4

Month navigators

5

Month and year

6

Days

7

Current date

8

Container

9

Date range start

10

Date range selected

11

Date range end

12

Date

Configuration

Hint text

Use hint text to clarify the expected date format.

Default. Use when the label alone is enough.

Selection mode

Datepicker can collect a single date or a date range.

User picks one date from the calendar.

Min and max date

Restrict the selectable date window using minDate and maxDate as ISO strings.

All dates can be selected.

Drop direction

Control whether the calendar opens above or below the input.

Calendar drops below the input.

Disabled

Disable the datepicker so users cannot change the value.

Default interactive state.

Validation feedback

Show error styling and a feedback message when the date is invalid.

No feedback shown.

Pre-selected value

Use a value when the datepicker should open with an existing date or date range.

Use empty when the user must provide a new date.

Required

Mark datepicker as required when the form cannot be submitted without a date.

Use optional when the date is not mandatory.

Auto-flipping

Use noFlip to prevent the calendar from changing direction automatically.

Allow the calendar to choose the best direction based on available space.

Structure

Design tokens used

Each row is a colour, spacing, or size value the component uses, and the right-most column tells you where in the component you'll see it.

CategoryTokenValueWhere it's usedPaddingsgds-form-padding-xSpace between the left and right edges of the component and its contentsgds-form-padding-ySpace between the top and bottom edges of the component and its contentGapsgds-form-gap-mdSpacing between items of the datepicker headersgds-form-gap-smSpacing between items of the dropdown menuTypographysgds-font-size-14Font size of items inside the componentsgds-font-size-label-smFont size of month and year picker buttonssgds-font-weight-semiboldFont weight of the th; value of the sgds buttonsgds-line-height-2-xsHeight variesLine height of month and year picker buttonssgds-line-height-20Height variesLine height of the button.year; line height of the thsgds-line-height-2424pxOuter spacing of the calendar buttonSizesgds-dimension-4848pxHeight of the input containersgds-dimension-160160pxMinimum width of the inputsgds-dimension-320320pxMaximum width of the dropdown menusgds-icon-size-smSize of the datepicker calendar iconBordersgds-form-border-radius-mdCorner radius of the sgds datepicker input; corner radius of the sgds icon buttonsgds-form-border-radius-smCorner radius of the button.year; corner radius of the td.active when keyboard-focused and when activeSizesgds-form-height-lgHeight variesHeight of the thOutlinesgds-form-outline-focusFocus outline of the td when keyboard-focusedsgds-form-outline-offset-focusFocus-outline offset of the td when keyboard-focusedSizesgds-form-width-mdWidth variesWidth of the th

Usage

When to use

  • Use datepicker when users need to choose a calendar date and seeing nearby dates helps reduce errors.
  • Use it for date selection, not for broad date instructions or timelines.

When not to use

  • Do not use datepicker when users need to enter a different kind of value, such as freeform text or a date range explanation.
  • Do not rely on placeholder text alone to explain the expected format.

Best practices

Use the datepicker for calendar-relevant dates

Use the datepicker when the day of the week or surrounding dates matter, such as appointments or travel.

Do not use the datepicker for dates the user already knows

For dates users can recall and type confidently, like a date of birth, a plain text input is faster.

Constrain the calendar to the dates users can actually choose

Set minDate and maxDate to limit selection to valid dates. For example, future dates only when scheduling.

Do not leave the format ambiguous

Use hintText to show the expected date format so users do not confuse day-month with month-day order.

Accessibility considerations

Built-in accessibility

  • Datepickers combine an input, trigger button, and calendar dialog.
  • The calendar dialog exposes its current view with an accessible dialog label.

Labels and content

  • Use a visible label and hint text when the expected date format needs support.
  • Keep validation feedback close to the datepicker.

Focus and interaction

  • When the calendar opens, SGDS moves focus into the calendar.
  • When the calendar closes, SGDS returns focus to the input.

Keyboard interaction

KeyInteractionTabMoves focus from the datepicker control to the next focusable element.Shift+TabMoves focus to the previous interactive element.↓ Downor↑ UpOpens the datepicker menu or moves focus between available options.EnterActivates the focused focused date.EscCloses the open datepicker when supported by the component.

Updates

DateVersionDescription13 May 2026v3.19.0Update typography css variables in #650.29 Apr 2026v3.18.0Icon button neutral in #609.29 Aug 2025v3.3.0Value becomes a prop over initialValu, add deprecation notice to initialValue prop and prevent `sgds-change-date `from running on first load @clukhei in #297.

Roadmap

Planned itemStatusTargetFuture enhancements for datepickerPlannedTBD

Feedback

Have suggestions or feedback?

Share them with us on Slack → #ask-sgds-v3

Bug Reports

Found a bug or issue?

Report it on GitHub Issues → sgds/components/datepicker

Singapore Government Design System

The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

Past VersionsSGDS v1SGDS v2