---
title: "Date Field"
description: "Type a date, or a date and a time, one part at a time, with a label, help text, and an error. Good for a date people know, such as a birthday."
url: https://gelatinui.com/components/date-field
markdown_url: https://gelatinui.com/components/date-field.md
access: free
install: "npx shadcn@latest add @gelatin-ui/date-field"
registry_item: https://gelatinui.com/r/date-field.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Date Field

> Type a date, or a date and a time, one part at a time, with a label, help text, and an error. Good for a date people know, such as a birthday.

Page: https://gelatinui.com/components/date-field

## When to use it

Best for: Typing a known date, or a date and a time, one segment at a time, with no calendar.

- Use it for a date that people know, such as a date of birth.
- Use `granularity` (`day`, `hour`, `minute`, `second`) to add time segments.
- Use `minValue`, `maxValue`, `isDateUnavailable`, or `validate`, and show the result with `DateFieldError`.

## When not to use it

- To let people also pick from a calendar, use a [Date Picker](https://gelatinui.com/components/date-picker.md).
- For a time with no date, use a [Time Field](https://gelatinui.com/components/time-field.md).
- For a start date and an end date, use a [Date Range Picker](https://gelatinui.com/components/date-range-picker.md).

## Notes for agents

- Put a `DateInput` inside `DateField`. The root does not render the segments by itself.
- Use `DateFieldLabel`, not `FieldLabel`. The Base UI `Field` parts cannot label a React Aria field.
- Values come from `@internationalized/date`, such as `parseDate("1990-06-14")`. They are not strings or `Date` objects.
- The props are `disabled`, `readOnly`, `invalid`, `required`, and `onValueChange`, not the React Aria `is*` and `onChange` names.
- With no children, `DateFieldError` shows the built-in messages in the browser language. Pass children for the app language.

## Anatomy

```text
DateField
├─ DateFieldLabel (0..n)
├─ DateFieldGroup (0..n)
├─ DateFieldDescription (0..n)
└─ DateFieldError (0..n)
```

## API reference

### DateField

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `validate` | `function` |  | A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if `validationBehavior="native"`. For realtime validation, use the `isInvalid` prop instead. |
| `value` | `T \| null` |  | The current value (controlled). |
| `defaultValue` | `T \| null` |  | The default value (uncontrolled). |
| `aria-label` | `string` |  | Defines a string value that labels the current element. |
| `aria-labelledby` | `string` |  | Identifies the element (or elements) that labels the current element. |
| `aria-describedby` | `string` |  | Identifies the element (or elements) that describes the object. |
| `aria-details` | `string` |  | Identifies the element (or elements) that provide a detailed, extended description for the object. |
| `id` | `string` |  | The element's unique identifier. See MDN. |
| `name` | `string` |  | The name of the input element, used when submitting an HTML form. See MDN. |
| `form` | `string` |  | The `<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. |
| `dir` | `string` |  |  |
| `lang` | `string` |  |  |
| `hidden` | `boolean` |  |  |
| `inert` | `boolean` |  |  |
| `translate` | `"no" \| "yes"` |  |  |
| `suppressHydrationWarning` | `boolean` |  | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| `onClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<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>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<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>` |  |  |
| `onKeyDown` | `function` |  | Handler that is called when a key is pressed. |
| `onKeyUp` | `function` |  | Handler that is called when a key is released. |
| `onFocus` | `function` |  | Handler that is called when the element receives focus. |
| `onBlur` | `function` |  | Handler that is called when the element loses focus. |
| `onFocusChange` | `function` |  | Handler that is called when the element's focus status changes. |
| `autoFocus` | `boolean` |  | Whether the element should receive focus on render. |
| `style` | `StyleOrFunction<DateFieldRenderProps>` |  | The inline style for the element. A function may be provided to compute the style based on component state. |
| `children` | `ChildrenOrFunction<DateFieldRenderProps>` |  | The children of the component. A function may be provided to alter the children based on component state. |
| `slot` | `string \| null` |  | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |
| `validationBehavior` | `"aria" \| "native"` | 'native' | Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA. |
| `render` | `DOMRenderFunction` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `minValue` | `DateValue \| null` |  | The minimum allowed date that a user may select. |
| `maxValue` | `DateValue \| null` |  | The maximum allowed date that a user may select. |
| `isDateUnavailable` | `function` |  | Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. |
| `placeholderValue` | `T \| null` |  | A placeholder date that influences the format of the placeholder shown when no value is selected. Defaults to today's date at midnight. |
| `hourCycle` | `12 \| 24` |  | Whether to display the time in 12 or 24 hour format. By default, this is determined by the user's locale. |
| `granularity` | `Granularity` |  | Determines the smallest unit that is displayed in the date picker. By default, this is `"day"` for dates, and `"minute"` for times. |
| `hideTimeZone` | `boolean` | false | Whether to hide the time zone abbreviation. |
| `shouldForceLeadingZeros` | `boolean` |  | Whether to always show leading zeros in the month, day, and hour fields. By default, this is determined by the user's locale. |
| `autoComplete` | `string` |  | Describes the type of autocomplete functionality the input should provide if any. See MDN. |
| `disabled` | `boolean` |  | Turns off the control: no focus, no edits, and the disabled look. |
| `readOnly` | `boolean` |  | The user can focus and read the value, but cannot change it. |
| `invalid` | `boolean` |  | Shows the invalid look and sets `aria-invalid`. |
| `required` | `boolean` |  | The form needs a value before it submits. |
| `onValueChange` | `function` |  | Runs on each change, with the new value and the Base UI change details. |
| `className` | `string` |  |  |

### DateFieldLabel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `render` | `DOMRenderFunction<"label", undefined>` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `elementType` | `string` |  |  |
| `className` | `string` |  |  |

### DateFieldGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `variant` | `"dashed" \| "default"` |  |  |
| `size` | `ControlSizeAtLeastSm` |  |  |
| `readOnly` | `boolean` |  | Read-only: the muted frame with no hover. Inside a `DateField` or `TimeField` the group reads it from the field; set it in a picker, which has no field state above the group. |

### DateFieldDescription

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `render` | `DOMRenderFunction<any, any>` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `className` | `string` |  |  |
| `ref` | `Ref<HTMLElement>` |  |  |

### DateFieldError

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` |  | The element's unique identifier. See MDN. |
| `dir` | `string` |  |  |
| `lang` | `string` |  |  |
| `hidden` | `boolean` |  |  |
| `inert` | `boolean` |  |  |
| `translate` | `"no" \| "yes"` |  |  |
| `suppressHydrationWarning` | `boolean` |  | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| `onClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLDivElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<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>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLDivElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLDivElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLDivElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLDivElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<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>` |  |  |
| `style` | `StyleOrFunction<FieldErrorRenderProps>` |  | The inline style for the element. A function may be provided to compute the style based on component state. |
| `children` | `ChildrenOrFunction` |  | The children of the component. A function may be provided to alter the children based on component state. |
| `render` | `DOMRenderFunction` |  | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
| `elementType` | `string` | 'span' | The HTML element type to render. Defaults to `'span'`. Set to `'div'` when using block-level children (e.g. `<ul>`) to avoid invalid HTML. |
| `className` | `string` |  |  |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| DateField | `date-field` |  |  |  |
| DateFieldLabel | `date-field-label` | `data-disabled` |  |  |
| DateFieldGroup | `date-field-group` |  |  |  |
| DateFieldDescription | `date-field-description` |  |  |  |
| DateFieldError | `date-field-error` |  |  |  |

## Usage

Put a `DateInput` inside `DateField`. The value is a `CalendarDate` from `@internationalized/date`, or a date with a time.

```tsx title="birth-date.tsx"
import { parseDate } from "@internationalized/date";

import { DateField, DateFieldError, DateFieldLabel } from "@/components/ui/date-field";
import { DateInput } from "@/components/ui/date-input";

export function BirthDate() {
  return (
    <DateField defaultValue={parseDate("1991-04-17")}>
      <DateFieldLabel>Date of birth</DateFieldLabel>
      <DateInput />
      <DateFieldError />
    </DateField>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/date-field
```

It adds 26 registry items: 23 files, 3685 lines, and the npm packages `@base-ui/react`, `@internationalized/date`, `@mantine/hooks`, `clsx`, `react-aria-components`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Date Input](https://gelatinui.com/components/date-input.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Date Picker](https://gelatinui.com/components/date-picker.md): Pick Date Picker when people also need to pick the date in a calendar popup.
- [Time Field](https://gelatinui.com/components/time-field.md)
- [Date Input](https://gelatinui.com/components/date-input.md)
- [Calendar](https://gelatinui.com/components/calendar.md): Pick Calendar for a month grid that stays on the page, such as a booking view.

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | Moves focus to the next segment. Each editable segment is a tab stop. |
| Left Arrow, Right Arrow | Moves focus to the segment before or after. |
| Up Arrow, Down Arrow | Makes the value of the segment one step higher or lower. |
| Page Up, Page Down | Changes the value of the segment by a larger step. |
| Home, End | Sets the lowest or the highest value of the segment. |
| Digits | Types the value of the segment. |
| Backspace, Delete | Removes a digit or clears the segment. |

## Accessibility

It is a React Aria field. Each segment is a spin button, and the label names the whole group.

The help text and the error link to the field through `aria-describedby`. The error shows only while the value is invalid.

Each editable segment is a tab stop, and the arrow keys change its value.
