Components
Loading preview...
Calendar [React Day Picker]
npx shadcn@latest add https://21st.dev/r/originui/calendarimport { 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 };