Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Date Picker examples · Standard

Date Picker with Date and Time for React

A date picker with a time field under the calendar for picking a date and a time together.

Framework
UI library

A Date Picker with a Time field under the month. Pick a day, set the time, and the button reads both, such as October 10, 2026 at 12:00. The time is the browser's native time input in a Field. Use it for reminders, publishing times and meetings.

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 the time field stays reachable. Escape, a click outside or the button close it.

How does the time field work?

It's an Input with type="time", starting at 12:00 and updating its own value on change. The browser draws the hours and minutes and formats them in the user's locale.

Is the time stored with the date?

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

What does the button say?

The date in long form followed by at and the time, or Pick a date and time when no date is selected. The button prints the value itself, formatted with Intl.DateTimeFormat, so the text needs no date library.

How is the content laid out?

DatePickerContent is a column split by divide-y: the calendar with its padding, then a Field with a Time label and the input. The label is tied to the input by the field.

Can I limit the time to quarter hours?

Set step on the input in seconds, 900 for fifteen minutes, and min and max for opening hours. Browsers use them to validate the value.