Components
Loading preview...
Calendar [React-Area]
npx shadcn@latest add https://21st.dev/r/originui/calendar-rac"use client";
import { Calendar } from "@/components/ui/calendar-rac";
import { getLocalTimeZone, today } from "@internationalized/date";
import { useState } from "react";
import type { DateValue } from "react-aria-components";
function Component() {
const [date, setDate] = useState<DateValue | null>(today(getLocalTimeZone()));
return (
<div>
<Calendar className="rounded-lg border border-border p-2" value={date} onChange={setDate} />
<p
className="mt-4 text-center text-xs text-muted-foreground"
role="region"
aria-live="polite"
>
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 };