Time Input

Forms

A time input component for selecting hours and minutes. Supports both 12-hour and 24-hour formats.

Import

import { TimeInput } from "@/components/ui/time-input";

Usage

12-Hour Format

Default format with AM/PM toggle

Selected: 09:00

24-Hour Format

Military time format without AM/PM

With Error

Display validation errors

Please select a time during business hours

Disabled

Disabled state

API Reference

valueundefined
{ hours: number; minutes: number }

Controlled time value

defaultValue{ hours: 12, minutes: 0 }
{ hours: number; minutes: number }

Default time for uncontrolled usage

onValueChangeundefined
(time: TimeValue) => void

Callback when time value changes

labelundefined
string

Label text displayed above the input

use24Hourfalse
boolean

Use 24-hour format instead of 12-hour with AM/PM

placeholder"12:00"
string

Placeholder text

errorundefined
string

Error message to display

disabledfalse
boolean

Whether the input is disabled