ComponentsSelection & pickers
Date picker
A date field typed one part at a time, with a calendar in a popover, for one date or a range.
Single date
"use client";
import { CalendarDate } from "@internationalized/date";
import { DatePicker } from "@/components/miyuki-ui/date-picker";
export default function DatePickerDemo() {
return (
<DatePicker
className="w-full max-w-[15rem]"
label="Check-in"
defaultValue={new CalendarDate(2027, 2, 12)}
description="From 3 pm. The bath opens at 4."
/>
);
}Range
"use client";
import { CalendarDate } from "@internationalized/date";
import { DateRangePicker } from "@/components/miyuki-ui/date-picker";
export default function DatePickerRangeDemo() {
return (
<DateRangePicker
className="w-full max-w-[18rem]"
label="Stay"
defaultValue={{ start: new CalendarDate(2027, 2, 12), end: new CalendarDate(2027, 2, 15) }}
description="Three nights at Ryokan Shizuku."
/>
);
}Install
npx shadcn@latest add @miyuki-ui/date-pickerThis needs the @miyuki-ui registry in your components.json. See Using the shadcn CLI.
In a Next.js app
Date picker 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-16" />}>
<DatePicker label="Date" />
</Suspense>Props
DatePicker
Prop
Type
DateRangePicker
Prop
Type