Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

TimePicker

Choose a booking time with visible selection feedback.

Preview

Live preview

Changes apply to this preview only.

Book a delivery slot

Slots run every 15 minutes between 09:00 and 17:30. The field uses the native time input, so its 12- or 24-hour rendering follows the browser locale.

The 12- or 24-hour display follows the browser locale.

The clear button resets the slot.

10:00

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Sizes

sm, md and lg share the Input height scale.

Open preview

Constraints

min, max and step are forwarded to the native control, which keeps invalid keyboard values out of the field. step is expressed in seconds.

Open preview

Seconds and format

withSeconds keeps the seconds segment and defaults the step to one second. showFormatHint adds a note about the locale-driven 12/24-hour display.

Open preview

Usage

Treat the result as a time value; combine it with a date and timezone deliberately.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluTimePickerProps

Type source
PimoluTimePickerProps public API
NameTypeDefaultDescription
valuestring | null | undefined—Controlled time. Accepts `"HH:mm"`, or `"HH:mm:ss"` when `withSeconds` is set. `null` represents an empty field.
defaultValuestring | null | undefined—Initial time when uncontrolled.
onValueChange((value: string | null) => void) | undefined—Called with the next time string, or `null` when cleared.
withSecondsboolean | undefinedfalseShow and accept seconds. Sets the default step to 1 second.
minstring | undefined—Earliest selectable time.
maxstring | undefined—Latest selectable time.
stepnumber | undefined60, or 1 with secondsGranularity in seconds. Defaults to 60, or 1 with seconds.
labelReactNode—Visible label.
helperTextReactNode—Supporting text below the field.
errorMessageReactNode—Error text, replacing the helper text.
invalidboolean | undefinedfalseInvalid state without an error message.
clearableboolean | undefinedtrueRender the clear button when a time is selected. Defaults to true.
clearLabelstring | undefined—Accessible name of the clear button.
showFormatHintboolean | undefinedfalseExplain that the 12- or 24-hour rendering follows the browser locale. Off by default because the note is often redundant in a form.
formatHintstring | undefined—Overrides the default format hint text.
sizePimoluTimePickerSize | undefined"md"Visual size. Defaults to "md".
fullWidthboolean | undefinedfalseStretch to the parent width.
classNamestring | undefined—Class applied to the outer field.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLInputElement> | undefined—Standard React/HTML attribute.
disabledboolean | undefined—Standard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
requiredboolean | undefined—Standard React/HTML attribute.
value

string | null | undefined

No default extracted.

Controlled time. Accepts `"HH:mm"`, or `"HH:mm:ss"` when `withSeconds` is set. `null` represents an empty field.

defaultValue

string | null | undefined

No default extracted.

Initial time when uncontrolled.

onValueChange

((value: string | null) => void) | undefined

No default extracted.

Called with the next time string, or `null` when cleared.

withSeconds

boolean | undefined

Default: false

Show and accept seconds. Sets the default step to 1 second.

min

string | undefined

No default extracted.

Earliest selectable time.

max

string | undefined

No default extracted.

Latest selectable time.

step

number | undefined

Default: 60, or 1 with seconds

Granularity in seconds. Defaults to 60, or 1 with seconds.

label

ReactNode

No default extracted.

Visible label.

helperText

ReactNode

No default extracted.

Supporting text below the field.

errorMessage

ReactNode

No default extracted.

Error text, replacing the helper text.

invalid

boolean | undefined

Default: false

Invalid state without an error message.

clearable

boolean | undefined

Default: true

Render the clear button when a time is selected. Defaults to true.

clearLabel

string | undefined

No default extracted.

Accessible name of the clear button.

showFormatHint

boolean | undefined

Default: false

Explain that the 12- or 24-hour rendering follows the browser locale. Off by default because the note is often redundant in a form.

formatHint

string | undefined

No default extracted.

Overrides the default format hint text.

size

PimoluTimePickerSize | undefined

Default: "md"

Visual size. Defaults to "md".

fullWidth

boolean | undefined

Default: false

Stretch to the parent width.

className

string | undefined

No default extracted.

Class applied to the outer field.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

disabled

boolean | undefined

No default extracted.

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

required

boolean | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Label hours/minutes, preserve keyboard editing and explain unavailable times in text.
Read the accessibility guide →