Date Field

A date field allows users to enter and edit date values using a keyboard.

mmddyyyy
<DateField aria-label="Meeting date">
  <DateInput />
</DateField>

Installation

npx shadcn@latest add @dotui/date-field

Usage

Use DateField to allow users to enter and edit date values using a keyboard.

import { DateField } from "@/components/ui/date-field";
import { DateInput } from "@/components/ui/input";
import { Label } from "@/components/ui/field";
<DateField>
  <Label>Date</Label>
  <DateInput />
</DateField>

Playground

Use the controls below to experiment with different date field props and see the live preview and code update.

Date
mmddyyyy
<DateField>
  <Label>Date</Label>
  <DateInput />
</DateField>

API Reference

DateField

A date field allows users to enter and edit date and time values using a keyboard. Each part of a date value is displayed in an individually editable segment.

PropType
boolean
boolean
((date: DateValue) => boolean)
T | null
12 | 24
Granularity
boolean
boolean
ReactNode | function
T | null
T | null
function

DateInput

A date input groups the editable date segments within a date field.

PropType
"sm" | "md" | "lg"

Last updated on 1/13/2026

Built with passion by @mehdibha.