React

Date Picker

A component that allows selecting a single date, date range, or multiple dates from a calendar.

Available since@seed-design/react@2.2.0, @seed-design/css@2.4.0

Installation

npm install @seed-design/react @seed-design/css

Props

DatePicker

Prop

Type

height?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
minHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
maxHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined

TwoMonthDatePicker

Prop

Type

height?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
minHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
maxHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined

WeekDatePicker

Prop

Type

height?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
minHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
maxHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined

ContinuousDatePicker

Prop

Type

height?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
minHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined
maxHeight?ResponsiveValue<(string & {}) | Dimension | "spacingX.betweenChips" | "spacingX.globalGutter" | "spacingY.componentDefault" | "spacingY.navToTitle" | "spacingY.screenBottom" | "spacingY.betweenText" | "full"> | undefined

Examples

Layout

Date Picker is divided into the following public components based on layout.

  • DatePicker: renders only the actual number of weeks in the current month.
  • TwoMonthDatePicker: displays two consecutive months horizontally. Previous and next buttons move one month at a time.
  • WeekDatePicker: displays only one week, and previous and next buttons move one week at a time.
  • ContinuousDatePicker: virtualizes months within monthRange vertically. If monthRange is omitted, yearRange is converted to a month range. You must specify one of height, minHeight, or maxHeight.

One-month and two-month layouts do not always reserve six-week height; they render only the 4-6 weeks needed for each month.

Date Picker does not restrict fixed or maximum width itself; it fills the width of its parent container. For one-month and two-month layouts, determine the required horizontal size by wrapping it with an appropriately sized container on the screen you are using.

Limiting exposed months in continuous calendars

You can limit the first and last months visible by scrolling with monthRange on ContinuousDatePicker. Both end months are included. If only yearRange is passed, it is converted from January of the starting year to December of the ending year. When using both props together, monthRange must be within yearRange.

monthRange determines which months are exposed, and constraints determines whether each date can be selected. The example below allows selection only from December 15 to January 14 (30 days later) while also limiting the scroll range to December and January.

Selection modes

Based on selectionMode, you can select a single date (single), date range (range), or multiple dates (multiple). The default is single.

  • The value of single is DatePickerDate.
  • range returns { start } immediately after selecting a start date, and { start, end } when a end date is selected.
  • multiple always returns a date array without duplicates in ascending order.

Date selection constraints

constraints is an array of functions that determine whether a candidate date can be selected. All functions must return true for a date to be selectable. You can write functions directly or combine the following helpers.

  • dateOnOrAfter, dateOnOrBefore: limit the date range inclusively.
  • excludeDates: excludes dates that cannot be selected, such as reservation dates or holidays. In Range mode, it checks the entire period from start date to candidate end date by default.
  • rangeDayCountAtLeast, rangeDayCountAtMost: limit the number of days including both start and end dates.
  • maxSelectionCount: limits the maximum number that can be selected in Multiple mode. Deselecting already selected dates is allowed.

Dates that do not meet the criteria can be focused with the keyboard but are in aria-disabled state and cannot be selected.

The example below limits the selection range including check-in and check-out to 1-14 days to allow same-day trips, and configures it so that ranges including reservation dates cannot be selected.

Keep the start date and change only the end date

When modifying an already started period, use selectionMode="range" and rangeStartReadOnly together. The existing start date is displayed in selected state but cannot be changed, and only dates later than the start date can be selected as the new end date.

rangeStartReadOnly requires value or defaultValue that includes the start date. When used in controlled mode, if the start date passed from outside changes, the new value is reflected in the Date Picker.

The ad period example below shows a situation where the start date is August 7 and today is August 10. Using dateOnOrAfter together, already passed dates like August 8 and 9 cannot be selected as the new end date.

Display additional information in date cells

When adding information such as price, availability, or congestion while maintaining the basic date number, prioritize using renderDateCellSupplement. The function receives the date and formatted date number, as well as selection, today, range, disabled, and focus states.

Use renderDateCellContent only when you cannot express something with renderDateCellSupplement and need to directly construct all internal content including the date number. This prop is not a general extension point but a low-level escape hatch, and the two props cannot be used simultaneously.

The component continues to own the DOM, ARIA, events, and state background of date cells. Therefore, in both functions, return only the content without creating buttons or gridcell. Each week's cell height expands to fit the tallest content. When content overflows horizontally on narrow screens, truncation policies such as maxLines are directly applied in the render function.

Combining with Time Picker

Date Picker uses DatePickerDate, a calendar date that does not interpret time or timezone. Manage state separately from Time Picker's TimePickerValue, and combine the two values at the server request or domain model boundary.

For services that require timezone, convert to CalendarDateTime, ZonedDateTime, or your service's date/time DTO at this point. Passing CalendarDateTime to Date Picker itself is not supported because the date selection UI would be unnecessarily coupled to timezone policy.

viewDate, defaultViewDate, onViewDateChange control the currently displayed month, week, and scroll reference point. Since Month is normalized to the first day of the month, use actionsRef when specifying a specific date cell as the navigation target.

  • navigateToDate(date): navigates to show the date and updates the next Tab entry point but maintains the current DOM focus. This action is recommended for external 'today' buttons.
  • focusDate(date): navigates to show the date and places actual DOM focus on the date cell. Used for keyboard shortcuts or actions that explicitly move users into the grid.

Month and year navigation

Clicking the title switches to a Wheel Picker like Time Picker. The year wheel does not repeat and moves within yearRange, while the month wheel repeats. The default value of yearRange is 100 years before and after based on today.

For Month series, the display reference date is normalized to the first day of the month, and Week to the locale's week start day.

Locale

The default locale is ko-KR. Month, weekday, date, and number notation, as well as the week start day, follow the locale. If weekStartsOn is passed, only the week start day is redefined. In RTL locales, left/right arrow keys and previous/next icon directions are also reversed.

Default accessibility names for the root, previous/next buttons, and year/month wheels are provided in Korean and English. If names suitable for your product context are needed, redefine them with ariaLabels.

Accessibility

Date Picker uses the WAI-ARIA Grid pattern. Only one date is in the tab order, and arrow keys move between dates.

  • ArrowLeft, ArrowRight: day before/after
  • ArrowUp, ArrowDown: week before/after
  • Home, End: start/end of current week
  • PageUp, PageDown: previous/next of current display unit
  • Shift + PageUp, Shift + PageDown: year before/after
  • Enter, Space: select focused date

If there is an element on the screen that represents the Date Picker's name, it can be connected with aria-labelledby. Otherwise, depending on the locale, "Select date" or a Korean equivalent is used.

Table of contents