Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Date Picker examples · Standard

Date Picker as Appointment Picker for React

A date picker that opens a calendar beside a list of time slots for booking an appointment.

Framework
UI library

A button that opens the Date Picker with the month on one side and fourteen time slots on the other, from 9:00 AM to 4:30 PM. Pick a day, then a time: the button reads the date at the time, such as October 10, 2026 at 10:30 AM. Use it for booking calls, visits and reservations where the day and the slot are chosen together.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

Why doesn't the picker close when I pick a day?

closeOnSelect is false on DatePicker, so it stays open for the time. Escape, a click outside or the button close it.

Where do the time slots come from?

A fixed list of fourteen strings in the file, half-hour steps with a lunch gap. The selected one is a solid button and the rest are outlined. Load the list for the picked day from your booking system to show real availability.

What does the button say?

The date in long form, plus at and the time once a slot is picked, or Pick a date and time with neither. The button prints the value itself, formatted with Intl.DateTimeFormat, so the text needs no date library.

How are the calendar and the slots laid out?

DatePickerContent is a row split by divide-x. The calendar keeps its padding, and the slots column has a fixed width with the Available Times heading and a Scroll Area that fills the calendar's height.

Is the time stored with the date?

No: the date is the picker's value and the time is a separate string. Combine them when you submit, for example into an ISO date-time.

Can I book from the keyboard?

Yes. The arrow keys move through the days and Enter picks one, then Tab reaches the slots, which are buttons.