Staaarter

Service And Slot Picker

A single hairline-bordered panel split into three independent sections: a selectable service list, a horizontally scrollable strip of day buttons, and a time slot grid. Each section has its own real single-select state, letting a visitor pick a service, a day, and a time slot in any order.

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 dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/service-and-slot-picker.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/booking/booking24.tsx instead.

Usage

The file also exports booking24Demo, 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 { Booking24, booking24Demo } from "@/components/blocks/booking/booking24";

export default function Page() {
  return <Booking24 {...booking24Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Book a service"Section heading above the panel.
descriptionstringnoneShort subheading under the heading.
servicesBookingService[]noneSelectable services in the first section.
daysDayOption[]noneDay buttons in the horizontally scrollable strip.
timeSlotsstring[]noneTime slot labels shown in the grid, reused for whichever day is selected.
classNamestringnoneExtra classes for the outer section element.

Types

interface BookingService {
  id: string;
  name: string;
  duration: string;
  price: string;
}

interface DayOption {
  id: string;
  label: string;
}

Behavior notes

  • selectedServiceId, selectedDayId, and selectedTime are three independent real useState values; clicking any item in any section updates only that section's state.
  • The day strip scrolls horizontally (overflow-x-auto) on narrow viewports instead of wrapping.
  • The time slot grid reuses the same timeSlots list regardless of which day is selected, since per-day availability isn't modeled in this block.