Command Palette

Search for a command to run...

Components · Complex component

DatePicker

A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.

Features

The DatePicker is a custom component following the DatePicker Aria Pattern. It has the following features:

  • Dates & times – Choose dates, times, or both with configurable precision.
  • International – 13+ calendar systems, locale formats, number systems, RTL, and hour cycles.
  • Time zone aware – Handles daylight saving and time zone rules.
  • Accessible – Keyboard navigation, screen reader support, and a calendar popover.
  • Touch friendly – Optimized for mobile keyboards and touch screen readers.
  • Validation – Works with forms, supports required/min/max, disabled dates, and custom rules.
  • Customizable – Full control over DOM and styling.

Usage

TSX
import { DatePicker } from '@console/nimbus-ui/core';

Examples

Granularity

Time Zones

Minimum And Maximum Values

Unavailable Dates

Invalid

API

PropTypeDefaultDescription
autoFocusboolean—
classNamestring—
defaultOpenboolean—
defaultValueDateValue—
descriptionstring—
errorMessagestring | ((validation: ValidationResult) => string)—
granularityenum—
hideTimeZoneboolean—
idstring—
isDateUnavailable(date: DateValue) => boolean—
isDisabledboolean—
isInvalidboolean—
isOpenboolean—
isReadOnlyboolean—
isRequiredboolean—
labelReactNode—
maxValueDateValue—
minValueDateValue—
namestring—
onChange(value: MappedDateValue<T>) => void—
onOpenChange(isOpen: boolean) => void—
placeholderValueDateValue—
refForwardedRef<HTMLDivElement>—
validate(value: MappedDateValue<T>) => true | ValidationError—
valueDateValue—