Installation
Usage
"use client"
import * as React from "react"
import { DateTimePicker } from "@/components/date-time-picker"
export function Booking() {
const [when, setWhen] = React.useState<string | null>(null)
return <DateTimePicker label="Meeting time" name="when" value={when} onValueChange={setWhen} />
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | — | Field label. |
| mode | "datetime" | "date" | "time" | "datetime" | What to pick. "time" is a Time Picker. |
| value / defaultValue | string | null | null | Local text: 2026-12-25T09:30, 2026-12-25 or 09:30. |
| onValueChange | (value: string | null) => void | — | Called when the value changes. |
| hourCycle | 12 | 24 | 12 | Clock shown on the wheels and in text. |
| minuteStep | 1 | 5 | 10 | 15 | 30 | 5 | Gap between minutes on the wheel. Typing can set any minute. |
| weekStartsOn | 0 | 1 | 0 | First day of the week. |
| dateOrder | "mdy" | "dmy" | "mdy" | How to read 3/4/2027. |
| locale | string | visitor's | Month and weekday names. |
| name | string | — | Sends the value with a form. |
| disabled | boolean | false | Turn the field off. |
Accessibility
- A labelled text field; what was understood, or why it wasn't, is announced as you type.
- Wheels are spin buttons: arrow keys, Home, End and Page keys work, and each announces its value.
- Calendar days are buttons named with the full date.
- Wheels jump instead of gliding under prefers-reduced-motion.
Changelog
- v1.0.0Latest
First release.