Date & Time Picker
A split-panel appointment scheduler. The left panel is an interactive monthly calendar with prev/next navigation, a highlighted "today", a few disabled demo days, and single-day selection. The right panel groups time slots into Morning and Afternoon sections for single-slot selection. A summary footer echoes the selected date and time, or a placeholder until both are chosen.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/date-time-picker.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/booking/booking1.tsx instead.
Usage
The file also exports booking1Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Booking1, booking1Demo } from "@/components/blocks/booking/booking1"; export default function Page() { return <Booking1 {...booking1Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Book an appointment" | Section heading above the calendar. |
| description | string | none | Short subheading under the heading. |
| initialYear | number | 2026 | Year the calendar opens on. |
| initialMonth | number | 2 | Month the calendar opens on, 0-11. |
| todayDay | number | 12 | Day-of-month treated as "today" for the highlight ring. |
| disabledDays | number[] | none | Day-of-month numbers that render disabled and unclickable in every month shown. |
| morningSlots | string[] | none | Time slot labels shown in the Morning group. |
| afternoonSlots | string[] | none | Time slot labels shown in the Afternoon group. |
| className | string | none | Extra classes for the outer section element. |
Behavior notes
- The calendar's prev/next buttons, day selection, and time slot selection are all real useState: currentMonth (year + month), selectedDate, and selectedTime.
- Disabled days are unclickable and visually struck through; the "today" ring is a fixed demo day (todayDay), not the real device date, so the block renders identically on every load.
- The footer summary and the Confirm booking button read directly from the same selection state; the Confirm button is disabled until both a date and a time are picked, and the click itself is decorative (no real submit).
More Booking Blocks
View all →reservation-summary
Reservation Summary
A static booking confirmation card with service, date/time, provider avatar, price breakdown, promo code field, and cancellation policy.
appointment-list
Appointment List
Upcoming and past appointments grouped by date, with provider avatar, status badge, and reschedule/cancel actions.
service-selector
Service Selector
Category-tabbed grid of bookable services with icon, description, duration, and price.
provider-picker
Provider Picker
A selectable grid of staff/provider cards with rating, reviews, availability, and an Any Provider fallback.
restaurant-reservation
Restaurant Reservation
Table reservation form with a guest stepper, date/time inputs, seating pills, and a live summary panel.
hotel-room-booking
Hotel Room Booking
Selectable room cards with photos and amenities, plus check-in/out dates and a live-computed total.