Date Picker
Pick a day or a range. Type a date straight into the field, or open the calendar under it. The calendar is also its own component, built on react-day-picker like shadcn's, so its props carry over.
Install
npx shadcn@latest add @nelumbo/date-picker # adds @nelumbo/calendar tooCalendar
Days are circles: the selection is filled, today is outlined, a range is a soft band between two filled ends. Months slide as you page. With one month, the title opens a year grid; arrow keys move through days and years.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
Date picker
Type the date in the locale's order; the separators fill themselves in. Alt+↓ or the calendar button opens the calendar. A date outside min and max, or on a disabled day, is flagged when you leave the field.
MM/DD/YYYY
Weekdays from Nov 20 to Feb 28.
DD.MM.YYYY
Choose a start date.
Due date: Dec 4, 2026
Range picker
Two months side by side (one on a phone), with optional presets. What you pick is a draft until Apply, so looking around doesn't change the value. A new click after a full range starts a new one.
Check-in to check-out.
Usage
import { DatePicker, DateRangePicker } from "@/components/ui/date-picker"import { Calendar } from "@/components/ui/calendar"<DatePicker label="Due date" value={date} onValueChange={setDate} /><DatePicker label="Delivery" min={new Date()} disabledDays={{ dayOfWeek: [0, 6] }} name="delivery" /><DatePicker label="Geburtsdatum" locale="de-DE" weekStartsOn={1} /><DateRangePicker label="Report period" value={range} onValueChange={setRange} presets={[{ label: "Last 7 days", range: () => ({ from: addDays(new Date(), -6), to: new Date() }) }]}/>// shadcn's Calendar code works as is<Calendar mode="single" selected={date} onSelect={setDate} />Props
| Prop | Type | Default | Calendar takes every react-day-picker prop as well. |
|---|---|---|---|
value / defaultValue | Date | null (range: DateRange | null) | ||
onValueChange | (value) => void | A typed date fires once it's complete and allowed | |
min / max | Date | Earlier and later days are disabled, and the calendar stops there | |
disabledDays | Matcher | Matcher[] | Any DayPicker matcher: dates, ranges, { dayOfWeek } | |
locale | string | "en-US" | Typed order and separator, month and weekday names |
weekStartsOn | 0–6 | 0 | 0 is Sunday |
name | string | Submits YYYY-MM-DD (a range as name[from] and name[to]) | |
label, variant, size, icon, description, error | As on Input | ||
DateRangePicker presets | { label, range }[] | range can be a function, worked out on open | |
DateRangePicker numberOfMonths | number | 2 | Phones show one |
Calendar yearPicker | boolean | true | The title opens a year grid (one month only) |
Calendar lang | string | "en-US" | Month and weekday names, through Intl |
Calendar showOutsideDays | boolean | false |