---
title: "Date Input"
description: "The row of date and time parts inside Date Field, Time Field, and the pickers. You type each part or move it with the arrow keys."
url: https://gelatinui.com/components/date-input
markdown_url: https://gelatinui.com/components/date-input.md
access: free
install: "npx shadcn@latest add @gelatin-ui/date-input"
registry_item: https://gelatinui.com/r/date-input.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Date Input

> The row of date and time parts inside Date Field, Time Field, and the pickers. You type each part or move it with the arrow keys.

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

## When to use it

Best for: The row of date or time segments inside a Date Field, a Time Field, or a picker.

- Use `DateInput` inside a `DateField`, a `TimeField`, or a picker. It reads the value and the segments from there.
- Use `DateInputGroup` to add an icon, a time zone text, a clear button, or the button of a picker.
- Pass a function as `children` to render your own `DateInputSegment`.

## When not to use it

- For a full date control with a label, help text, and an error, use a [Date Field](https://gelatinui.com/components/date-field.md).
- For a full time control with a label, help text, and an error, use a [Time Field](https://gelatinui.com/components/time-field.md).

## Notes for agents

- `DateInput` needs a `DateField`, a `TimeField`, or a picker above it. It holds no value of its own.
- It fills the width of its parent, so set a width on the field (`w-60`). A frame that is too narrow clips at its end.
- Inside a `DateInputGroup`, the group sets the size. The `size` on `DateInput` applies only to a plain input.
- Inside a `DateField` or `TimeField`, the group reads read-only from the field. In a picker, set `readOnly` on the group.
- `I18nProvider` sets the order, the separators, the digits, and the placeholders of the segments.
- `name` goes on the field, not on `DateInput`. A hidden `<input>` after the row holds the ISO value.

## Anatomy

```text
DateInput
├─ DateInputSegment (0..n)
└─ DateInputGroup (0..n)
```

## API reference

### DateInputSegment

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `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<HTMLSpanElement>` |  |  |
| `onClickCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseDown` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseDownCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseEnter` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseLeave` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseMove` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseMoveCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseOut` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseOutCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseOver` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseOverCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseUp` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onMouseUpCapture` | `MouseEventHandler<HTMLSpanElement>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLSpanElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLSpanElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLSpanElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLSpanElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLSpanElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLSpanElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLSpanElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLSpanElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLSpanElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLSpanElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLSpanElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLSpanElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLSpanElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLSpanElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLSpanElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLSpanElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLSpanElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLSpanElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<HTMLSpanElement>` |  |  |
| `onTransitionCancel` | `TransitionEventHandler<HTMLSpanElement>` |  |  |
| `onTransitionCancelCapture` | `TransitionEventHandler<HTMLSpanElement>` |  |  |
| `onTransitionEnd` | `TransitionEventHandler<HTMLSpanElement>` |  |  |
| `onTransitionEndCapture` | `TransitionEventHandler<HTMLSpanElement>` |  |  |
| `onTransitionRun` | `TransitionEventHandler<HTMLSpanElement>` |  |  |
| `onTransitionRunCapture` | `TransitionEventHandler<HTMLSpanElement>` |  |  |
| `onTransitionStart` | `TransitionEventHandler<HTMLSpanElement>` |  |  |
| `onTransitionStartCapture` | `TransitionEventHandler<HTMLSpanElement>` |  |  |
| `onHoverStart` | `function` |  | Handler that is called when a hover interaction starts. |
| `onHoverEnd` | `function` |  | Handler that is called when a hover interaction ends. |
| `onHoverChange` | `function` |  | Handler that is called when the hover state changes. |
| `style` | `StyleOrFunction<DateSegmentRenderProps>` |  | 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. |
| `segment` | `DateSegment` |  |  |
| `className` | `string` |  |  |

### DateInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `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<DateInputRenderProps>` |  | The inline style for the element. A function may be provided to compute the style 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. |
| `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. |
| `className` | `string` |  |  |
| `children` | `DateInputPrimitiveProps["children"]` |  | The segment for each part of the date. Leave it out for one `DateInputSegment` per part, or render your own: `{(segment) => <DateInputSegment segment={segment} className="…" />}`. |
| `size` | `ControlSizeAtLeastSm` |  | The height of a plain input (28, 32, 36). Inside a `DateInputGroup`, the group sets it. |
| `ref` | `Ref<HTMLDivElement>` |  |  |

### DateInputGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `variant` | `"dashed" \| "default"` |  |  |
| `size` | `ControlSizeAtLeastSm` | "default" |  |
| `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. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| DateInputSegment | `date-input-segment` | `aria-readonly`, `data-focused`, `data-hovered`, `data-placeholder`, `data-type` | `--radius` |  |
| DateInput | `date-input` | `data-focus-within`, `data-invalid`, `data-readonly` | `--date-input-shift` | `hit-area`, `motion-timing` |
| DateInputGroup | `date-input-group` | `data-disabled`, `data-focus-within`, `data-input-group-control`, `data-invalid`, `data-open`, `data-readonly` |  |  |

## Usage

Put the Date Input in a Date Input Group with an icon add-on, inside a Date Field that owns the value.

The sample also uses `date-field`, which this add does not write. One command adds them with this item:

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

```tsx title="departure-date.tsx"
import { parseDate } from "@internationalized/date";
import { CalendarIcon } from "@phosphor-icons/react/ssr";

import { DateField, DateFieldLabel } from "@/components/ui/date-field";
import { DateInput, DateInputGroup, DateInputSegment } from "@/components/ui/date-input";
import { InputGroupAddon } from "@/components/ui/input-group";

export function DepartureDate() {
  return (
    <DateField defaultValue={parseDate("2026-12-18")}>
      <DateFieldLabel>Departure date</DateFieldLabel>
      <DateInputGroup>
        <InputGroupAddon>
          <CalendarIcon aria-hidden />
        </InputGroupAddon>
        <DateInput>
          {(segment) => {
            return <DateInputSegment segment={segment} />;
          }}
        </DateInput>
      </DateInputGroup>
    </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-input
```

It adds 16 registry items: 13 files, 2636 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `react-aria-components`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Input Group](https://gelatinui.com/components/input-group.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 Field](https://gelatinui.com/components/date-field.md)
- [Time Field](https://gelatinui.com/components/time-field.md)
- [Date Picker](https://gelatinui.com/components/date-picker.md)

## 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

Each segment is a spin button with its own name, such as month or year. The parent field names the group.

Each editable segment is a tab stop. The fixed text between segments takes no focus.

On a coarse pointer, `hit-area` grows the target to 44px. The size on the screen stays the same.
