DateField
The <DateField>
allows users to enter and edit date values using a keyboard. Each part of a date value, including the calendar date, time, and timezone, is displayed in an individually editable segment. These segments are individually focusable and editable by the user, by typing or using the arrow keys to increment and decrement the value. This approach allows values to be formatted and parsed correctly regardless of the locale or date format, and offers an easy and error-free way to edit all aspects of a date using the keyboard.
Anatomy
A <DateField>
consists of a label and a group of segments representing each unit of a date, such as the calendar date, time, and timezone.

Appearance
The appearance of a component can be customized using the variant
and size
props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.
Property | Type | Description |
---|---|---|
variant | - | The available variants of this component. |
size | - | The available sizes of this component. |
Usage
Date inputs play a critical role in many user flows such as reserving tickets, scheduling appointments, setting deadlines, or logging activity. These are moments where users expect clarity, guidance, and precision.
Use a date field when users need to select a specific day or time, when the date will be used for sorting or calculations, or when consistent formatting and validation are important. It is especially helpful in workflows where precision matters, like booking systems, calendars, or reporting tools. A structured input helps prevent common errors like swapped day and month formats, forgotten timezones, or typos.
Partial Dates
Avoid using a date field when only part of the date is needed, such as just the month or year, or when the date is vague, optional, or generated by the system. In those cases, a simpler input may better match user expectations and reduce friction.
For example, if only the month and year are required, such as when entering a credit card expiration date, a dedicated month/year input or two dropdowns is more appropriate. This simplifies the interaction and avoids the added complexity of a full date field. The following demo shows how this can be achieved without using a date field.
Granularity
Adjust the level of granularity in a date field based on what the user needs to provide. For example, if users only need to select a day (like for a birthday), there’s no need to show time or timezone fields. If the context involves scheduling or deadlines, including time, and sometimes timezone, may be essential.
Use only as much detail as the use case requires. This keeps the input focused, reduces user effort, and avoids unnecessary complexity.
By default, the granularity is set to day, but it can be adjusted to include time and even show timezone when needed.
Use helpers from the @internationalized/date package to provide date values. This ensures correct handling of calendars, time zones, and localization across different regions.
Props
action?
ReactElement<any, string | JSXElementConstructor<any>>;
aria-describedby?
string;
aria-details?
string;
aria-label?
string;
aria-labelledby?
string;
autoComplete?
string;
autoFocus?
boolean;
defaultValue?
DateValue | null;
description?
ReactNode;
dir?
string;
disabled?
boolean;
true
, the date field is disabled."false"
error?
boolean;
true
, the field is considered invalid and if set the errorMessage is shown instead of the description
."false"
errorMessage?
ReactNode | ((v: ValidationResult) => ReactNode);
form?
string;
<form>
element to associate the input with.
The value of this attribute must be the id of a <form>
in the same document.
See MDN.granularity?
Granularity;
"day"
for dates, and "minute"
for times.hidden?
boolean;
hideTimeZone?
boolean;
"false"
hourCycle?
12 | 24;
id?
string;
inert?
boolean;
isDateUnavailable?
(date: DateValue) => boolean;
label?
ReactNode;
lang?
string;
maxValue?
DateValue | null;
minValue?
DateValue | null;
name?
string;
onAnimationEnd?
AnimationEventHandler<HTMLDivElement>;
onAnimationEndCapture?
AnimationEventHandler<HTMLDivElement>;
onAnimationIteration?
AnimationEventHandler<HTMLDivElement>;
onAnimationIterationCapture?
AnimationEventHandler<HTMLDivElement>;
onAnimationStart?
AnimationEventHandler<HTMLDivElement>;
onAnimationStartCapture?
AnimationEventHandler<HTMLDivElement>;
onAuxClick?
MouseEventHandler<HTMLDivElement>;
onAuxClickCapture?
MouseEventHandler<HTMLDivElement>;
onBlur?
(e: FocusEvent<Element, Element>) => void;
onChange?
(value: DateValue | null) => void;
onClick?
MouseEventHandler<HTMLDivElement>;
onClickCapture?
MouseEventHandler<HTMLDivElement>;
onContextMenu?
MouseEventHandler<HTMLDivElement>;
onContextMenuCapture?
MouseEventHandler<HTMLDivElement>;
onDoubleClick?
MouseEventHandler<HTMLDivElement>;
onDoubleClickCapture?
MouseEventHandler<HTMLDivElement>;
onFocus?
(e: FocusEvent<Element, Element>) => void;
onFocusChange?
(isFocused: boolean) => void;
onGotPointerCapture?
PointerEventHandler<HTMLDivElement>;
onGotPointerCaptureCapture?
PointerEventHandler<HTMLDivElement>;
onKeyDown?
(e: KeyboardEvent) => void;
onKeyUp?
(e: KeyboardEvent) => void;
onLostPointerCapture?
PointerEventHandler<HTMLDivElement>;
onLostPointerCaptureCapture?
PointerEventHandler<HTMLDivElement>;
onMouseDown?
MouseEventHandler<HTMLDivElement>;
onMouseDownCapture?
MouseEventHandler<HTMLDivElement>;
onMouseEnter?
MouseEventHandler<HTMLDivElement>;
onMouseLeave?
MouseEventHandler<HTMLDivElement>;
onMouseMove?
MouseEventHandler<HTMLDivElement>;
onMouseMoveCapture?
MouseEventHandler<HTMLDivElement>;
onMouseOut?
MouseEventHandler<HTMLDivElement>;
onMouseOutCapture?
MouseEventHandler<HTMLDivElement>;
onMouseOver?
MouseEventHandler<HTMLDivElement>;
onMouseOverCapture?
MouseEventHandler<HTMLDivElement>;
onMouseUp?
MouseEventHandler<HTMLDivElement>;
onMouseUpCapture?
MouseEventHandler<HTMLDivElement>;
onPointerCancel?
PointerEventHandler<HTMLDivElement>;
onPointerCancelCapture?
PointerEventHandler<HTMLDivElement>;
onPointerDown?
PointerEventHandler<HTMLDivElement>;
onPointerDownCapture?
PointerEventHandler<HTMLDivElement>;
onPointerEnter?
PointerEventHandler<HTMLDivElement>;
onPointerLeave?
PointerEventHandler<HTMLDivElement>;
onPointerMove?
PointerEventHandler<HTMLDivElement>;
onPointerMoveCapture?
PointerEventHandler<HTMLDivElement>;
onPointerOut?
PointerEventHandler<HTMLDivElement>;
onPointerOutCapture?
PointerEventHandler<HTMLDivElement>;
onPointerOver?
PointerEventHandler<HTMLDivElement>;
onPointerOverCapture?
PointerEventHandler<HTMLDivElement>;
onPointerUp?
PointerEventHandler<HTMLDivElement>;
onPointerUpCapture?
PointerEventHandler<HTMLDivElement>;
onScroll?
UIEventHandler<HTMLDivElement>;
onScrollCapture?
UIEventHandler<HTMLDivElement>;
onTouchCancel?
TouchEventHandler<HTMLDivElement>;
onTouchCancelCapture?
TouchEventHandler<HTMLDivElement>;
onTouchEnd?
TouchEventHandler<HTMLDivElement>;
onTouchEndCapture?
TouchEventHandler<HTMLDivElement>;
onTouchMove?
TouchEventHandler<HTMLDivElement>;
onTouchMoveCapture?
TouchEventHandler<HTMLDivElement>;
onTouchStart?
TouchEventHandler<HTMLDivElement>;
onTouchStartCapture?
TouchEventHandler<HTMLDivElement>;
onTransitionCancel?
TransitionEventHandler<HTMLDivElement>;
onTransitionCancelCapture?
TransitionEventHandler<HTMLDivElement>;
onTransitionEnd?
TransitionEventHandler<HTMLDivElement>;
onTransitionEndCapture?
TransitionEventHandler<HTMLDivElement>;
onTransitionRun?
TransitionEventHandler<HTMLDivElement>;
onTransitionRunCapture?
TransitionEventHandler<HTMLDivElement>;
onTransitionStart?
TransitionEventHandler<HTMLDivElement>;
onTransitionStartCapture?
TransitionEventHandler<HTMLDivElement>;
onWheel?
WheelEventHandler<HTMLDivElement>;
onWheelCapture?
WheelEventHandler<HTMLDivElement>;
placeholderValue?
DateValue | null;
readOnly?
boolean;
true
, the date field is readOnly."false"
ref?
Ref<HTMLInputElement>;
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}required?
boolean;
true
, the date field is required."false"
shouldForceLeadingZeros?
boolean;
slot?
string | null;
null
value indicates that the local props completely override all props received from a parent.translate?
"yes" | "no";
validate?
(value: DateValue) => true | ValidationError | null;
validationBehavior="native"
. For realtime validation, use the isInvalid
prop instead.validationBehavior?
"native" | "aria";
'native'
value?
DateValue | null;
width?
WidthProp;
'full'
Alternative components
DatePicker: a user interface element that allows users to select a date from a calendar.