Black Friday is here 🔥 Get Wensity Pro for 20% less with

Time Picker

React time picker on Base UI with a typeable time input, rolling digits, a popover of scrolling columns, 12 and 24 hour clocks and min and max times.

Loading preview

Overview

Time Picker is a React and Tailwind CSS time picker with a typeable time input and a Base UI popover of scrolling columns, in Next.js or any React app. Each part of the field is a spinbutton: type digits to fill it, step with the arrow keys, clear with Backspace. hourCycle switches between a 12 hour clock with AM/PM and a 24 hour clock, and seconds adds a third part. Times outside min and max are disabled. The value is a 24 hour string like 17:30 and stays null until every part is filled, so handle null in onValueChange.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add time-picker

Usage

Import TimePicker from @/components/wensity/time-picker and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
"use client";
import * as React from "react";
import { TimePicker } from "@/components/wensity/time-picker";
export function MeetingTime() {
const [time, setTime] = React.useState<string | null>("09:30");
return (
<TimePicker
label="Starts"
value={time}
onValueChange={setTime}
min="08:00"
max="18:00"
/>
);
}

Props

PropTypeDefaultDescription
valuestring | null-Controlled 24 hour value, "HH:mm" or "HH:mm:ss". null leaves the field empty.
defaultValuestring-Starting value when uncontrolled.
onValueChange(value: string | null) => void-Called with the 24 hour string, or null while any part is empty.
hourCycle12 | 241212 adds an AM/PM part, 24 runs 00 to 23. The value stays 24 hour.
secondsbooleanfalseAdds a seconds part and column.
minuteStepnumber5Minutes between list options and per arrow key press. Typing takes any minute.
secondStepnumber5Seconds between list options and per arrow key press.
minstring-Earliest time. Earlier options are disabled and typed times snap up on blur.
maxstring-Latest time. Later options are disabled and typed times snap down on blur.
variant"field" | "inline""field"A typeable field with a popover list, or the list on its own.
size"sm" | "md" | "lg""md"Control height and text size.
rollingbooleantrueRolls each digit up or down as the value changes.
openboolean-Controlled popover state.
defaultOpenbooleanfalseOpens the popover on first render.
onOpenChange(open: boolean) => void-Called when the popover opens or closes.
labelReact.ReactNode-Label above the field, used as the group name.
hintReact.ReactNode-Helper text under the field. Hidden while error is set.
errorReact.ReactNode-Error message under the field, with invalid styling.
namestring-Submits the 24 hour string with a form through a hidden input.
fullWidthbooleanfalseStretches the field to fill its container.
disabledbooleanfalseBlocks every interaction.
readOnlybooleanfalseShows the time but blocks edits and the popover.
  • Count Up Animation component preview

    Count Up Animation

    A count up animation for React: every digit rolls into place, in any number format.

  • Text Char Slide component preview

    Text Char Slide

    A per-character slide-left cascade with a cleanly staggered entrance timing.

  • Gooey Dropdown Menu component preview

    Gooey Dropdown Menu

    A capsule trigger drips a menu out of its underside. Arrow keys, live shortcuts, and a clear Delete row come built in.

  • Multi-Step Form Wizard component preview

    Multi-Step Form Wizard

    A multi-step form wizard whose card physically reshapes to wrap each new step as the content slides in behind it.