Components
Loading preview...
Calendar [React Day Picker]
npx shadcn@latest add https://21st.dev/r/originui/calendar"use client";
import { Calendar } from "@/components/ui/calendar";
import { useState } from "react";
function Component() {
const [date, setDate] = useState<Date | undefined>(new Date());
return (
<div>
<Calendar
mode="single"
selected={date}
onSelect={setDate}
className="rounded-lg border border-border p-2"
/>
<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://daypicker.dev/"
target="_blank"
rel="noopener nofollow"
>
React DayPicker
</a>
</p>
</div>
);
}
export { Component };