Time Input
An input-style time input with scrollable hour and minute columns.
TimeInput combines an input-style trigger, Popover, and 140px fixed-height ScrollArea columns for hours and minutes. The active value stays centered while surrounding choices remain legible. A value is committed when its wheel settles, and remains selected if the popover is dismissed.
Contract
Section titled “Contract”Overview
Machine-readable contract from Component Spec.
component: time-inputexport: TimeInputversion: 1tokens.visual: inputattributes: data-refineui=time-input
Anatomy
| Part | data-refineui |
|---|---|
| root | time-input |
States
| Scope | Category | Values |
|---|---|---|
| component | pseudo | focus-visible |
| component | component | selection: placeholder, value |
| component | component | validation: error, success |
| component | availability | disabled |
| component | environment | dir |
Accessibility
| Slot | Element | Native | Labeling |
|---|---|---|---|
| time-input | button | true | accessibleName: required |
Keyboard
| Key | Action | Native |
|---|---|---|
| Enter | activate | true |
| Space | activate | true |
Focus
| Section | Property | Value |
|---|---|---|
| visual | required | true |
| visual | selector | :focus-visible |
Layout
| Property | Value |
|---|---|
| direction | logical |
| rtl | true |
Installation
Section titled “Installation”npm install @refineui/react @refineui/tokens yarn add @refineui/react @refineui/tokens pnpm add @refineui/react @refineui/tokens bun add @refineui/react @refineui/tokens import { useState } from "react";import { TimeInput } from "@refineui/react"; const [time, setTime] = useState("09:30"); <TimeInput value={time} onValueChange={setTime} minuteStep={15} hourCycle="12h" />; Time values always use the 24-hour HH:mm format. Set hourCycle="12h" to show a leading, scrollable AM/PM column. size="xs" | "sm" | "md" | "lg" | "xl" matches Input and inherits a surrounding Field size.
API Reference
Section titled “API Reference”| Prop | Default | Type | Description |
|---|---|---|---|
| value | — | string | Controlled value in HH:mm format. |
| defaultValue | — | string | Initial uncontrolled HH:mm value. |
| onValueChange | — | (value: string) => void | Called when a wheel selection settles. |
| minuteStep | 1 | 1 | 5 | 10 | 15 | 30 | Minute increments in the scrollable list. |
| hourCycle | "24h" | "24h" | "12h" | Shows an AM/PM column in 12-hour mode. |
| size | "lg" | "xs" | "sm" | "md" | "lg" | "xl" | Matches Input control sizing. |
| error / success / disabled | false | boolean | Input state styling and availability. |