Staaarter

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.

By Staaarter Team
Booking
Docs
Live preview

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.json

Prefer 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

PropTypeDefaultDescription
headingstring"Book an appointment"Section heading above the calendar.
descriptionstringnoneShort subheading under the heading.
initialYearnumber2026Year the calendar opens on.
initialMonthnumber2Month the calendar opens on, 0-11.
todayDaynumber12Day-of-month treated as "today" for the highlight ring.
disabledDaysnumber[]noneDay-of-month numbers that render disabled and unclickable in every month shown.
morningSlotsstring[]noneTime slot labels shown in the Morning group.
afternoonSlotsstring[]noneTime slot labels shown in the Afternoon group.
classNamestringnoneExtra 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).