TimePicker

Two wheels set one time. A large readout follows them as you spin, and Now jumps both to the current minute. Inputs.

Open playground
Start time9:00 AM
  • 00
  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07
  • 08
  • 09
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 00
  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07
  • 08
  • 09
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59

About

TimePicker is a React component in the Inputs category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { TimePicker } from "@ashutoshswamy/smoui" and set hour12, label, defaultValue among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { TimePicker } from "@ashutoshswamy/smoui";

<TimePicker label="Start time" defaultValue="09:30" onChange={setTime} />

Props 4

hour12

Show the readout as 9:30 AM. The value stays HH:mm.

boolean
label

Visible name for the two-wheel group.

string
defaultValue

Initial 24-hour HH:mm time.

stringdefault "09:00"
onChange

Emits HH:mm as either wheel moves.

(time: string) => void