shadcn.io is not affiliated with official shadcn/ui
Date Picker examples · Standard
Date Picker with Range for React
A date range picker that shows two months side by side.
A Date Picker in range mode with this month and the next side by side. Click a start and an end; the days between are shaded, and the button reads the range, such as Oct 06, 2026 - Oct 22, 2026. Use it for bookings, reports and filters that cover a period.
Preview
Installation
FAQ
Which props make it a range picker?
selectionMode="range" and numOfMonths={2} on DatePicker. The content renders the visible month and the next one in two tables, under one header with the previous and next arrows.
Where are the start and end stored?
In the value, a list of two dates: start, then end. It starts on the 6th and 22nd of the current month, and the calendar opens there.
How does the button format the range?
Each date with Intl.DateTimeFormat as a short month, two-digit day and year, joined with a hyphen. With only a start it prints that date, and with nothing, Pick a date range.
Does picking the end date close the picker?
Yes, a complete range closes it. Set closeOnSelect to false to keep it open, for example when you add presets beside the months.
Related
- Date Picker as Appointment PickerA date picker that opens a calendar
- Date Picker with Natural LanguageA date picker with quick-select shortcuts
- Date Picker with Disabled DatesA date picker that disables weekends, a
- Date Picker with Date and TimeA date picker with a time field under the
- Date Picker with Month and Year SelectorA date picker with month and year
- Date Picker with Multiple Day SelectionA date picker for choosing several