Time picker

Choose a time with sensible keyboard behavior.

npx shadcn@latest add @silicon-ui/time-picker
timefield
Loading…

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/time-picker

Manually

  1. Install the dependencies.

    npm install lucide-react motion
  2. Copy these files into your project. Shared files are skipped if you already have them.

    • components/silicon-ui/time-picker/time-picker.tsx
    • components/silicon-ui/time-picker/time-picker.module.css
  3. Install the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

Source codetsx
import { TimePicker } from "@/components/silicon-ui/time-picker/time-picker";

API reference

PropTypeDefault
label*string—
valuestring—
defaultValuestring"09:00"
onChange(value: string) => void—
descriptionstring—
placeholderstring"Select a time"
minuteStep1 | 5 | 10 | 15 | 30

15101530

15
format"12h" | "24h""12h"
disabledbooleanfalse
classNamestring—

Dependencies

npm
lucide-reactmotion
Registry
silicon-motion-tokens