shadcn.io is not affiliated with official shadcn/ui
Calendar examples · Dialog
Calendar with Multiple Day Selection in Dialog for React
A button that opens a dialog with a calendar for selecting several separate days.
The multiple-day calendar inside a Dialog: a Select Dates button opens it, titled Select Multiple Dates, and each click toggles a day. Use it when people mark availability as one step of a flow.
Preview
Installation
FAQ
How do I read the selected days?
mode="multiple" makes selected an array of dates and onSelect the setter. This demo starts with the 6th, the 15th and the 24th of the current month.
Which days start selected?
The 6th, the 15th and the 24th of the current month. State starts as those three dates, before the dialog opens.
How is the dialog opened?
DialogTrigger is a button reading Select Dates. It opens DialogContent with sm:max-w-fit, and DialogTitle reads Select Multiple Dates.
What does the change handler receive?
onSelect receives the next array of dates, and this demo stores it with setDates.
Related
- Calendar with Multiple Day SelectionA calendar that selects several separate
- Calendar with Range in DialogA button that opens a dialog with a
- Standard DialogA share dialog with a read-only link, a
- Calendar with Disabled Dates in DialogA button that opens a dialog with a
- Calendar with Date and Time in DialogA button that opens a dialog with a
- Button with Text (Standard)The one filled action