DocsComponentsTemplatesThemesGitHub

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.json

Guidelines

  • mode="range" picks start then end. Weeks start Monday; output uses the user's locale.

Props

PropTypeRequired
styleReact.CSSPropertiesNo
mode'single' | 'range'No
valueDate | { start: Date; end: Date | null } | nullNo
defaultValueDate | { start: Date; end: Date | null } | nullNo
onChange(value: any) => voidNo
labelstringNo
placeholderstringNo
minDateNo
maxDateNo
classNamestringNo

Edit this example on GitHub