Time Field

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

––––AM
<TimeField aria-label="Event time">
  <DateInput />
</TimeField>

Installation

npx shadcn@latest add @dotui/time-field

Usage

Use TimeField to allow users to enter and edit time values using a keyboard.

import { TimeField } from "@/components/ui/time-field";
import { DateInput } from "@/components/ui/input";
import { Label } from "@/components/ui/field";
<TimeField>
	<Label>Time</Label>
	<DateInput />
</TimeField>

Playground

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

Time
––––AM
<TimeField>
  <Label>Time</Label>
  <DateInput />
</TimeField>

Examples

––––AM
Appointment time
––––AM
Please select a time between 9 AM and 5 PM.
Event time
––––AM
Meeting time
––––AM
Meetings start every 15 minutes.
Hour
11AM
Minute
1145AM
Second
114522AM
Appointment time
1045AM
1845
Event time
––––AM
Event time
––––AM
––––AM
––––AM
1100AM
Event time
––––AM
small (sm)
––––AM
medium (md)
––––AM
large (lg)
––––AM
1245AMPST
1145AM
1145AM

selected time: 11:45:00

API Reference

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

PropType
ReactNode | function
"hour" | "minute" | "second"
boolean
12 | 24
boolean
boolean
T
DOMRenderFunction<"div", DateFieldRenderProps>
boolean
T | null
T | null
function

Last updated on 5/22/2026