Date time picker

A date time picker allows the user to select an associated date and time.

Installation

Package installation information
Installyarn add @atlaskit/datetime-picker
SourceBitbucket.org, (opens new window)
npm@atlaskit/datetime-picker, (opens new window)
Bundleunpkg.com, (opens new window)

Props

appearance

Deprecated
Description

Set the appearance of the picker.

subtle will remove the borders and background.

Type"default" | "subtle" | "none"

aria-describedby

Description

Used to associate accessible descriptions to both the date and time picker. If you want to associate individual accessible descriptions, this should be done through the aria-describedby props on the datePickerProps and timePickerProps.

Typestring

autoFocus

Description

Set the picker to autofocus on mount.

Typeboolean

clearControlLabel

Description

Set the aria-label for the clear button. Add the word "Clear" at the beginning of the clearControlLabel. For instance, for a field to set an appointment, use "Clear appointment date and time".

Typestring

createAnalyticsEvent

Description

You should not be accessing this prop under any circumstances. It is provided by @atlaskit/analytics-next and integrated in the component

Type(payload: AnalyticsEventPayload) => UIAnalyticsEvent

datePickerProps

Description

Props applied to the DatePicker.

TypeDatePickerBaseProps

defaultValue

Description

The default for value.

Typestring

id

Description

Set the id of the field.

Typestring

innerProps

Deprecated
Description

Props to apply to the container.

If you are looking to set your width, use a Box from @atlaskit/primitives around the picker to achieve the same effect.

TypeAllHTMLAttributes<HTMLElement>

isDisabled

Description

Set if the field is disabled.

Typeboolean

isInvalid

Description

Set if the picker has an invalid value.

Typeboolean

isRequired

Description

Set the field as required.

Typeboolean

locale

Description

Locale used for formatting dates and times. See DateTimeFormat.

Typestring

name

Description

The name of the field.

Typestring

onBlur

Description

Called when the field is blurred.

Type(event: FocusEvent<HTMLInputElement, Element>) => void

onChange

Description

Called when the value changes and the date / time is a complete value, or empty. The only value is an ISO string or empty string.

Type(value: string) => void

onFocus

Description

Called when the field is focused.

Type(event: FocusEvent<HTMLInputElement, Element>) => void

parseValue

Description

Function used to parse datetime values into their date, time and timezone sub-values. *

Type(dateTimeValue: string, date: string, time: string, timezone: string) => { dateValue: string; timeValue: string; zoneValue: string; }

ref

Description

Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).

@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}

Typestring | Ref<HTMLDivElement>

spacing

Description

The spacing for the select control.

Compact is gridSize() * 4, default is gridSize() * 5.

Type"default" | "compact"

testId

Description

A testId prop is provided for specified elements, which is a unique string that appears as a data attribute data-testid in the rendered code, serving as a hook for automated tests

  • {testId}--datepicker--container wrapping element of date-picker
  • {testId}--timepicker--container wrapping element of time-picker
Typestring

timePickerProps

Description

Props applied to the TimePicker.

TypeTimePickerBaseProps

value

Description

The ISO time that should be used as the input value.

Typestring
Was this page helpful?
We use this feedback to improve our documentation.
© 2026 AtlassianTrademark, (opens new window)Privacy, (opens new window)License