Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-time-picker.json --yes

Time picker

Pro

A field for a time of day that a person types or picks from a list, such as a meeting's start, for React and Tailwind CSS. Part of Goop Pro.

Type a time in any common way ("9", "930", "9:30pm") and leave the field, or pick one from the list; set a meeting’s start and end (an end before the start is refused, the end list says each length); each time chosen, and a list open, is said under the fields; Save shows the 24-hour times the form sends. Nothing is booked: Save only reads the form.

When to use

  • A field for a time of day that a person types or picks from a list, such as a meeting's start.
  • Also called: time input.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Time picker on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-time-picker.json --yes
PROMPT
Add the Goop Time picker to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { TimePicker, TimeRangePicker } from '@/components/ui/goop/time-picker';
import { DatePicker, DatePickerTrigger, DatePickerValue, DatePickerContent, DatePickerPanel } from '@/components/ui/goop/date-picker';
import { Button } from '@/components/ui/goop/button';
import { Field } from '@/components/ui/goop/field';

<form>
  <div role="group" aria-label="Starts" className="flex gap-2">
    <DatePicker name="day">
      <DatePickerTrigger asChild>
        <Button variant="outline" shape="rounded" size="lg" className="min-w-0 flex-1 justify-start">
          <DatePickerValue placeholder="Date" />
        </Button>
      </DatePickerTrigger>
      <DatePickerContent aria-label="Date">
        <DatePickerPanel />
      </DatePickerContent>
    </DatePicker>
    <TimePicker aria-label="Time" name="time" step={30} className="w-26 shrink-0" />
  </div>
  <TimeRangePicker
    aria-label="Meeting"
    name="meeting"
    defaultValue={{ from: '09:00', to: '10:30' }}
    step={30}
    min="08:00"
    max="20:00"
  />
  <Field label="Reminder" orientation="vertical">
    <TimePicker
      name="reminder"
      hourCycle={12}
      locale="en-US"
      error="Type a time such as 9:30 AM."
    />
  </Field>
</form>
  • Fits: flow, schedule (their recipes).
  • Also known as: Input type="time", TimeField, TimeInput, TimeSelect, TimeRange.
  • Put a TimePicker beside a DatePicker in one row for a date and a time (a role="group" named once round the two, the time field w-26, the date trigger the rest), or a TimeRangePicker for a start and an end; set step, min and max to the hours the page allows.
  • height, width, padding, gap, text: add no class for these.

API reference

  • Each option with its sentence: time-picker--options.md
  • State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange)
Parts
PartWhat it is
TimeRangePickerA start and an end time of one day; its props: time-picker--time-range-picker.md
  • data-slot values (to select a part by): time-picker, time-picker-field, time-picker-input, time-picker-length, time-picker-value, time-range-picker, time-range-picker-dash

TimePicker: every option

TSX
import { TimePicker } from '@/components/ui/goop/time-picker';

Options

  • value?: string | null — The chosen time as 24-hour HH:MM, when the caller holds it (null for none).
  • defaultValue?: string — The time chosen at first (HH:MM), when the picker holds it.
  • onValueChange?: (value: string | null) => void — Called with the time chosen or typed (HH:MM), or null when it is cleared.
  • hourCycle?: 12 | 24 — The clock: 12 ("9:30 AM") or 24 ("09:30"); the language's if left out.
  • locale?: string — The language of the times (a BCP 47 tag); the page's, else the browser's, if left out.
  • step?: number — The minutes between the list's times, 15 if left out; a typed time off the step is kept.
  • min?: string — The earliest time (HH:MM): the list starts there and an earlier typed time is refused.
  • max?: string — The latest time (HH:MM): the list ends there and a later typed time is refused.
  • placeholder?: string — The words shown while no time is chosen.
  • name?: string — The form field's name: the chosen time is sent as HH:MM.
  • open?: boolean — Whether the list is open, when the caller holds it; with onOpenChange.
  • defaultOpen?: boolean — Whether the list is open at first.
  • onOpenChange?: (open: boolean) => void — Called as the list opens and closes.
  • error?: ReactNode — The error line under the field while what was typed is refused.
  • clearLabel?: string — The clear button's spoken name.
  • container?: HTMLElement | null — Where the list is drawn; the end of <body> when left out.
  • Also takes: onChange?: (event: ChangeEvent<HTMLInputElement>) => void; required?: boolean; disabled?: boolean; form?: string
  • State: value (value / defaultValue / onValueChange); open (open / defaultOpen / onOpenChange)

TimeRangePicker

A start and an end time of one day.

TSX
import { TimeRangePicker } from '@/components/ui/goop/time-picker';

Options

  • value?: TimeRange — The chosen range, when the caller holds it; with onValueChange.
  • defaultValue?: TimeRange — The range chosen at first, when the picker holds it.
  • onValueChange?: (value: TimeRange) => void — Called with the range after each change of either end.
  • name?: string — The form fields' name: hidden fields send <name>-from and <name>-to as HH:MM.
  • fromLabel?: string = 'Start time' — The start field's spoken name.
  • toLabel?: string = 'End time' — The end field's spoken name.
  • fromPlaceholder?: string = 'Start' — The start field's placeholder.
  • toPlaceholder?: string = 'End' — The end field's placeholder.
  • orderMessage?: ReactNode = 'The end time must be after the start time.' — The sentence under the end field while the end is at or before the start.
  • Types: TimeRange = { from?: string; to?: string }

Keyboard

KeyWhat it does
ArrowDown Alt+ArrowDownOpen the list of times, the chosen one (else the one nearest now) highlighted; open, move the highlight down
ArrowUpOpen the list; open, move the highlight up (Alt+ArrowUp closes it)
PageUp PageDownMove the highlight five times up or down
Home EndWith the list open, move the highlight to the first or the last time
EnterTake the highlighted time, or read the typed words, and close the list
EscapeClose the list; a second Escape puts the last good time back in the field
TabRead the typed words and move on; the focus never enters the list

Accessibility

  • The native element answers the keyboard.
  • hover, focus-visible: the browser's own (:hover, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
disabledthe prop disabled

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/time-picker.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-time-picker.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.