Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Time Picker

ProNew

A list of times at a fixed step, labelled in the locale's 12-hour or 24-hour form.

Installation

pnpm dlx shadcn@latest add @viewport/time-picker

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
valuestring

The time as `HH:mm` in 24-hour form, e.g. `"14:30"`.

—
defaultValuestring—
onValueChange(value: string) => void—
stepnumber

Minutes between options.

30
minstring

The first and last options, as `HH:mm`.

"00:00"
maxstring"23:59"
placeholderstring

Shown while no time is chosen.

"Pick a time"
localestring

A BCP 47 tag. It decides between 12-hour and 24-hour labels.

—
namestring

Submits the `HH:mm` value with a form.

—

Accessibility

  • Built on Radix Select: arrow keys and typeahead, opening on the chosen time.
  • Submits a 24-hour `HH:mm` value with forms.
  • No scale animation under reduced motion.