Components

Calendar

An animated React calendar built on react-day-picker v10 and shadcn/ui — a gliding selected-day pill, a today ring, range styles and months that slide in the direction you navigate — plus a date picker and a date range picker with presets, built with Radix Popover and Motion.

  • shadcn API
  • react-day-picker v10
  • Keyboard grid
  • date-fns
  • prefers-reduced-motion
June 2026

Installation

$ npx shadcn@latest add https://duskui.com/r/calendar.json

Built for react-day-picker v10. Every DayPicker prop works, plus buttonVariant for the month buttons. Month transitions use DayPicker's animate prop, on by default; pass animate={false} to turn them off. To avoid hydration mismatches, pass fixed today and defaultMonth dates when a calendar is rendered on the server.

Usage

booking.tsx
"use client"

import * as React from "react"
import { Calendar } from "@/components/ui/calendar"

export function Booking() {
  const [date, setDate] = React.useState<Date | undefined>()

  return <Calendar mode="single" selected={date} onSelect={setDate} />
}

Examples

Single date

Pick a day and the mint pill glides over from the previous one. Today keeps a neutral background so you can always find it. Use the arrows (or PageUp / PageDown) to change month: the weeks slide in from the side you moved toward.

June 2026

Range

mode="range" draws solid caps on the first and last day joined by a tinted band. With numberOfMonths={2} the months sit side by side and stack on small screens.

June 2026
July 2026

captionLayout="dropdown" swaps the caption for native month and year selects, styled to match. Set startMonth and endMonth to bound them — handy for birthdays.

March 1994

Disabled days & week numbers

Pass any react-day-picker matcher to disabled — here past days and weekends — and showWeekNumber for a week column. Disabled days are skipped by keyboard navigation.

June 2026
23
24
25
26
27

Weekdays from today onward.

Blocks

Ready-made variations composed from the base component with Motion. Each installs on its own and pulls in its dependencies automatically.

Date Picker

A button that opens the Calendar in a popover. The panel scales out of the trigger, focus moves into the grid, and picking a day closes it and rolls the formatted date into the trigger. Pass name to submit the date in a form as yyyy-MM-dd.

Delivery date

We deliver every day, including weekends.

$ npx shadcn@latest add https://duskui.com/r/date-picker.json
PropTypeDefaultDescription
value / defaultValueDate | undefined—Controlled or initial date.
onValueChange(date: Date | undefined) => void—Called when a date is picked (or cleared by clicking it again).
placeholderstring"Pick a date"Trigger text when empty.
dateFormatstring"PPP"date-fns format for the trigger.
disabledDaysMatcher | Matcher[]—Days that can't be picked, e.g. { before: today }.
namestring—Submits the date in a hidden input.
calendarPropsCalendarProps—Extra Calendar props such as today, defaultMonth, startMonth or captionLayout.
contentClassNamestring—Classes for the popover panel. className styles the trigger.

Date Range Picker

Two months side by side with quick ranges — Today, Last 7 days, This month and more. A pill glides to the active preset, choosing one slides the calendar to that range, and a footer counts the days with Clear and Done. Bring your own presets with presets.

Report period
$ npx shadcn@latest add https://duskui.com/r/date-range-picker.json
PropTypeDefaultDescription
value / defaultValueDateRange | undefined—Controlled or initial range ({ from, to }).
onValueChange(range: DateRange | undefined) => void—Called on every change.
presets{ label: string; getRange: (today: Date) => { from: Date; to: Date } }[]defaultRangePresetsQuick ranges in the side panel. [] hides it.
numberOfMonthsnumber2Months shown side by side.
todayDate—Reference date for presets. Defaults to the current date when the picker opens.
dateFormatstring"LLL d, y"date-fns format for each end of the range.
disabledDaysMatcher | Matcher[]—Days that can't be picked.
calendarPropsCalendarProps—Extra Calendar props.

API Reference

Calendar forwards every react-day-picker prop. The most used ones:

PropTypeDefaultDescription
mode"single" | "multiple" | "range"—Selection mode. In single mode the selected pill glides between days.
selected / onSelectDate | Date[] | DateRange—The selection and its change handler.
todayDate—Overrides today. Pass a fixed date for server rendering.
month / defaultMonth / onMonthChangeDate—The displayed month, controlled or not.
numberOfMonthsnumber1Months shown at once.
captionLayout"label" | "dropdown" | "dropdown-months" | "dropdown-years""label"Caption text or month / year selects.
disabledMatcher | Matcher[]—Days that can't be selected.
animatebooleantrueSlide months in the navigation direction. Off under reduced motion.
showOutsideDaysbooleantrueShow days from the neighbouring months.
buttonVariantButton variant"ghost"Variant of the previous / next month buttons.

Accessibility

  • react-day-picker renders a role="grid" per month with labelled day buttons, aria-selected and a roving tab stop, so only one day is in the tab order.
  • Full keyboard support: arrow keys move by day and week, Home / End to the week edges, PageUp / PageDown by month and Shift+PageUp / PageDown by year. Disabled days are skipped.
  • The month caption is a polite live region, so changing month is announced. Month buttons have labels like "Go to the Next Month".
  • The pickers use Radix Popover: focus moves into the calendar on open, Escape closes it and focus returns to the trigger.
  • Under prefers-reduced-motion months swap instantly, the selected pill jumps and popovers only fade.