Components › Forms

Time field

A time input in segments. Arrows step, digits type, left and right move between hours, minutes and AM/PM.

Installation

npx plankui@latest add time-field

Usage

import { TimeField } from "@/components/ui/time-field";

<TimeField value={time} onValueChange={setTime} hour12 step={15} />

API reference

PropTypeDefaultDescription
value / defaultValue{ hours: number; minutes: number }9:00Hours are 0 to 23.
onValueChange(time) => voidCalled when a segment changes.
hour12booleanfalseShow a 12-hour clock with AM/PM.
stepnumber1Minutes per arrow press.

View the source on GitHub