DatePicker
Date or date-range field that opens a calendar popover.
Code
import * as React from 'react';
import { DatePicker } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 320,
minHeight: 420,
}}
>
<DatePicker label="Date range" mode="range" />
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { DatePicker } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/date-picker.jsonGuidelines
mode="range"picks start then end. Weeks start Monday; output uses the user's locale.
Props
| Prop | Type | Required |
|---|---|---|
style | React.CSSProperties | No |
mode | 'single' | 'range' | No |
value | Date | { start: Date; end: Date | null } | null | No |
defaultValue | Date | { start: Date; end: Date | null } | null | No |
onChange | (value: any) => void | No |
label | string | No |
placeholder | string | No |
min | Date | No |
max | Date | No |
className | string | No |