Origin UI

Calendar [React Day Picker]

Component 3

About

Calendar [React Day Picker]

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Calendar [React Day Picker] to your project and fits it to your theme.

Code

How Calendar [React Day Picker] is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Calendar } from "@/components/ui/calendar";
import { addDays } from "date-fns";

function Component() {
  const today = new Date();

  return (
    <div>
      <Calendar
        mode="range"
        disabled={[
          { before: new Date() },
          new Date(),
          { dayOfWeek: [0, 6] },
          {
            from: addDays(today, 14),
            to: addDays(today, 16),
          },
          {
            from: addDays(today, 23),
            to: addDays(today, 24),
          },
        ]}
        excludeDisabled
        className="rounded-lg border border-border p-2 bg-background"
      />
      <p
        className="mt-4 text-center text-xs text-muted-foreground"
        role="region"
        aria-live="polite"
      >
        Disabled dates -{" "}
        <a
          className="underline hover:text-foreground"
          href="https://daypicker.dev/"
          target="_blank"
          rel="noopener nofollow"
        >
          React DayPicker
        </a>
      </p>
    </div>
  );
}

export { Component };

Dependencies

More by Origin UI

View all
  • Dialog

    Dialog

    1.2K
  • Avatar

    Avatar

    951
  • useImageUpload

    useImageUpload

    926
  • usePagination

    usePagination

    622
  • Popover

    Popover

    384
  • Button

    Button

    364
  • Command

    Command

    321
  • Accordion

    Accordion

    258