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 CommonInputsProp — label, caption, error, warning, and optional.
Disabled & Read-only
Controlled
API Reference
Prop | Required | Default | Type |
|---|---|---|---|
| icon | true | 'clock' | IconPropsV2['name'] | undefined |
| label | true | string | |
| caption | true | string | |
| error | true | string | |
| warning | true | string | |
| optional | true | boolean | |
| size | true | 'md' | md | sm |
| step | true | number | |
| disabled | true | boolean | |
| readOnly | true | boolean | |
| className | true | string | |
| wrapperClassName | true | string |