Origin UI

Calendar [React-Area]

Component 72

About

Calendar [React-Area]

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

Code

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

Usage.tsx

"use client";

import { RangeCalendar } from "@/components/ui/calendar-rac";
import { getLocalTimeZone, today } from "@internationalized/date";
import { useState } from "react";
import type { DateRange } from "react-aria-components";

function Component() {
  const now = today(getLocalTimeZone());
  const [date, setDate] = useState<DateRange | null>({
    start: now,
    end: now.add({ days: 3 }),
  });

  return (
    <div>
      <RangeCalendar
        className="rounded-lg border border-border p-2 bg-background"
        value={date}
        onChange={setDate}
      />
      <p
        className="mt-4 text-center text-xs text-muted-foreground"
        role="region"
        aria-live="polite"
      >
        Range calendar -{" "}
        <a
          className="underline hover:text-foreground"
          href="https://react-spectrum.adobe.com/react-aria/DateRangePicker.html"
          target="_blank"
          rel="noopener nofollow"
        >
          React Aria
        </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