Origin UI

Calendar [React Day Picker]

Buttons 7

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

"use client";

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

function Component() {
  const today = new Date();
  const selectedDay = addDays(today, -28);
  const [month, setMonth] = useState(selectedDay);
  const [date, setDate] = useState<Date | undefined>(selectedDay);

  return (
    <div>
      <div className="rounded-lg border border-border p-2">
        <Calendar
          className="bg-background"
          mode="single"
          selected={date}
          onSelect={setDate}
          month={month}
          onMonthChange={setMonth}
        />
        <Button
          variant="outline"
          size="sm"
          className="my-1"
          onClick={() => {
            setDate(today);
            setMonth(today);
          }}
        >
          Today
        </Button>
      </div>
      <p
        className="mt-4 text-center text-xs text-muted-foreground"
        role="region"
        aria-live="polite"
      >
        With button -{" "}
        <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

    950
  • useImageUpload

    useImageUpload

    926
  • usePagination

    usePagination

    622
  • Popover

    Popover

    384
  • Button

    Button

    361
  • Command

    Command

    320
  • Accordion

    Accordion

    256

More in Buttons

View all
  • Button

    Button

    14
  • Texture Button

    Texture Button

    92
  • Button

    Button

    63
  • Button

    Button

    34
  • Button Save

    Button Save

    46
  • Button

    Button

  • App Store Button

    App Store Button

    453
  • Notification Button

    Notification Button

    103