Skip to content

Design system

Documentation

DesignComponents / TimePicker

Components / TimePicker

Beta

TimePicker

Choose a local time with the browser's native time input.

On this page

Examples

Native time control

Use a native time control and receive a 24-hour string value.

Meeting time control

Include seconds

Enable second-level precision when the task needs it.

Time control with seconds

Try the props

Edit the time and toggle second-level precision.

TimePicker property playground

When to use

Use TimePicker for a local time-of-day value. Its value is a string in HH:mm form, or HH:mm:ss when seconds are enabled. It wraps the native input[type=time] so browser keyboard and locale behavior remain available.

Usage

import { TimePicker } from "@phuctech/ui/components/time-picker";

<TimePicker aria-label="Meeting time" defaultValue="09:30" minuteStep={15} />

API

Component API
PropTypeDefaultDescriptionConstraints
value / defaultValuestring—Controlled or initial native time value.Use HH:mm, or HH:mm:ss when showSeconds is enabled.
onValueChange(value: string) => void—Receives the native input's current time string.It does not convert the value into a date or time zone.
showSecondsbooleanfalseEnables seconds and defaults the native step to one second.The browser controls the rendered time picker UI.
minuteStepnumber1Sets the native time step in whole minutes when seconds are hidden.Finite positive values are floored; invalid values use one minute.
stepnumberderived from showSeconds/minuteStepOverrides the native input step in seconds.Use a value supported by the target browser's time input.
Input propsInputProps without type/value/defaultValue/onChangeInput defaultsForwards size, name, min/max, disabled, readOnly, required, ref, and aria attributes.Use aria-label or a surrounding Field label.

Tokens

Component tokens
TokenRoleEffective valueUsage
input / border / focus-ringTime controlShared Input stylingKeeps the native time field aligned with other form controls.

Accessibility

The underlying native input keeps browser keyboard behavior and form semantics. Supply a visible Field label or an accessible name; min, max, step, disabled, readOnly, and required are forwarded to the input.

Do and don’t

Do

Store the time string and combine it with a date only in the feature that owns that domain value.

Don’t

Assume a time-of-day value includes a date or an offset from UTC.

  • DatePicker selects a calendar date or range.
  • Input provides other native text input types.
  • Field adds visible labels and validation context.