ComponentsSelection & pickers
Date calendar
A month on the page for choosing one date or a range, with one or two months side by side.
Single date
"use client";
import { CalendarDate } from "@internationalized/date";
import { Calendar } from "@/components/miyuki-ui/date-calendar";
export default function DateCalendarDemo() {
return (
<div className="rounded-xl border border-border bg-card p-3 shadow-sm">
<Calendar aria-label="Departure date" defaultValue={new CalendarDate(2027, 2, 14)} />
</div>
);
}Range
"use client";
import { CalendarDate } from "@internationalized/date";
import { RangeCalendar } from "@/components/miyuki-ui/date-calendar";
export default function DateCalendarRangeDemo() {
return (
<div className="rounded-xl border border-border bg-card p-3 shadow-sm">
<RangeCalendar
aria-label="Nights at the inn"
defaultValue={{ start: new CalendarDate(2027, 2, 10), end: new CalendarDate(2027, 2, 14) }}
/>
</div>
);
}Two months
"use client";
import { CalendarDate, type DateValue } from "@internationalized/date";
import { RangeCalendar } from "@/components/miyuki-ui/date-calendar";
const booked = ["2027-02-19", "2027-02-20", "2027-03-12", "2027-03-13"];
export default function DateCalendarTwoMonthsDemo() {
return (
<div className="rounded-xl border border-border bg-card p-3 shadow-sm">
<RangeCalendar
aria-label="Nights at the inn"
visibleMonths={2}
defaultValue={{ start: new CalendarDate(2027, 2, 25), end: new CalendarDate(2027, 3, 3) }}
isDateUnavailable={(date: DateValue) => booked.includes(date.toString())}
/>
</div>
);
}Install
npx shadcn@latest add @miyuki-ui/date-calendarThis needs the @miyuki-ui registry in your components.json. See Using the shadcn CLI.
In a Next.js app
Date calendar reads today's date while it renders. With Cache Components turned on, Next.js stops the build unless that happens inside React's Suspense, so wrap it in one. Give the fallback the size of the control so nothing moves when it appears. Our blocks and templates that use it already do this.
import { Suspense } from "react";
<Suspense fallback={<div className="h-72" />}>
<Calendar aria-label="Date" />
</Suspense>Props
Calendar
Prop
Type
RangeCalendar
Prop
Type