Skip to content

Time Input

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.

Variations

Icon

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

Form states

TimeInput accepts all standard form field props via CommonInputsProp — label, caption, error, warning, and optional.

Disabled & read-only

Controlled

Pass value together with onChange to control the input. onChange receives the change event — read e.target.value for the new time.

Installation

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