shadcn.io is not affiliated with official shadcn/ui
Calendar examples · Standard
Calendar with Disabled Dates for React
A calendar that disables weekends, a five-day range and one specific date.
A Calendar that won't select weekends, the 3rd through the 7th of the current month, or the 22nd. Those days are dimmed and can't be picked. Use it for business days, delivery windows and anything with blackout dates.
Preview
Installation
FAQ
Which days can't be picked?
disabled takes three matchers: { from, to } for the 3rd through the 7th, { dayOfWeek: [0, 6] } for Saturday and Sunday, and new Date(year, month, 22) for the 22nd.
Why are those dates built from year, month and day?
Those dates use new Date(year, month, day), which is local midnight. A date-only string such as 2025-06-01 is midnight UTC, still the previous day in time zones west of UTC.
How do I read the selected date?
mode="single" makes selected one date and onSelect the setter. This demo stores that date in state, starting from new Date().
Related
- Calendar as Appointment PickerA calendar beside a scrolling list of
- Calendar with RangeA two-month calendar for selecting a
- Date Picker with RangeA date range picker that shows two months
- Calendar with Range in DialogA button that opens a dialog with a
- Calendar with Custom Select Day StyleA calendar with round days that
- Calendar with Date and TimeA calendar with a time input under it for