Time picker
Choose a time with sensible keyboard behavior.
npx shadcn@latest add @silicon-ui/time-pickerInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/time-pickerManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/time-picker/time-picker.tsx
- components/silicon-ui/time-picker/time-picker.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/lib/fluid-hover.tsx
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
label* | string | — |
value | string | — |
defaultValue | string | "09:00" |
onChange | (value: string) => void | — |
description | string | — |
placeholder | string | "Select a time" |
minuteStep | 1 | 5 | 10 | 15 | 30
| 15 |
format | "12h" | "24h" | "12h" |
disabled | boolean | false |
className | string | — |
Dependencies
- npm
- lucide-reactmotion
- Registry
- silicon-motion-tokens