Skip to content

Time Input

beta

The TimeInput component provides a styled time input field. It is built on top of BaseInput, using the same cn-input-container foundation as TextInput and NumberInput, and hides the browser’s native clock indicator in favour of a configurable IconV2 leading icon.

Usage

import { TimeInput } from '@harnessio/ui/components'
return (
<TimeInput
label="Start time"
id="start-time"
defaultValue="09:30"
caption="Select a time"
/>
)

Icon

The leading icon defaults to clock. Pass any IconV2 name via the icon prop, or pass undefined to hide the icon entirely.

Form integration

TimeInput accepts all standard form field props via CommonInputsProplabel, caption, error, warning, and optional.

Disabled & Read-only

Controlled

API Reference

Prop
Required
Default
Type
icontrue'clock'IconPropsV2['name'] | undefined
labeltruestring
captiontruestring
errortruestring
warningtruestring
optionaltrueboolean
sizetrue'md'md | sm
steptruenumber
disabledtrueboolean
readOnlytrueboolean
classNametruestring
wrapperClassNametruestring