TimePicker
Time slot dropdown built on Select (searchable), 12h or 24h, configurable step and hours.
Code
import * as React from 'react';
import { TimePicker } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 260,
minHeight: 60,
}}
>
<TimePicker label="Start time" defaultValue="09:30" startHour={7} endHour={20} />
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { TimePicker } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/time-picker.jsonGuidelines
- Type to jump ("9:3").
Props
| Prop | Type | Required |
|---|---|---|
value | string'HH:mm' | No |
defaultValue | string | No |
onChange | (value: string) => void | No |
step | numberminutes | No |
startHour | number | No |
endHour | number | No |
use24h | boolean | No |
searchable | boolean | No |
label | string | No |
hint | React.ReactNode | No |
error | React.ReactNode | No |
placeholder | string | No |
width | number | string | No |
className | string | No |
style | React.CSSProperties | No |