shadcn.io is not affiliated with official shadcn/ui
Date Picker examples · Standard
Date Picker with Disabled Dates for React
A date picker that disables weekends, a five-day range and one specific date.
A Date Picker that won't select weekends, the 3rd through the 7th of the current month, or the 22nd. Those days are struck through and dimmed, and they're skipped when you click them. Use it for business days, delivery slots and anything with blackout dates.
Preview
Installation
FAQ
How are the dates disabled?
isDateUnavailable on DatePicker gets each day and returns true for a weekend, a day in the range or the single date. Unavailable days can't be selected and show a line-through.
How are weekends detected?
The function turns the day into a Date and checks getDay() for Sunday or Saturday. For locales whose weekend falls on other days, compare against those days instead.
How is the blocked range written?
Two dates in the current month, the 3rd and four days later. A day is in the range when it compares at or after the start and at or before the end.
How do I block past dates?
Set min on DatePicker to today. Days before it are disabled and the calendar won't navigate earlier, which isDateUnavailable doesn't do.
Related
- Date Picker as Appointment PickerA date picker that opens a calendar
- Date Picker with RangeA date range picker that shows two months
- Date Picker with Custom Select Day StyleA date picker with round days that
- Date Picker with Natural LanguageA date picker with quick-select shortcuts
- Date Picker with Month and Year SelectorA date picker with month and year
- Date Picker with Date and TimeA date picker with a time field under the