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

PropTypeDefaultDescription
value{ hours: number; minutes: number }undefinedControlled time value
defaultValue{ hours: number; minutes: number }{ hours: 12, minutes: 0 }Default time for uncontrolled usage
onValueChange(time: TimeValue) => voidundefinedCallback when time value changes
labelstringundefinedLabel text displayed above the input
use24HourbooleanfalseUse 24-hour format instead of 12-hour with AM/PM
placeholderstring"12:00"Placeholder text
errorstringundefinedError message to display
disabledbooleanfalseWhether the input is disabled

Related Components