Hotel Room Booking
A hotel room booking block: selectable room type cards with a photo, amenity icon row, guest capacity, and nightly price, alongside check-in/check-out date inputs and a guest counter. A price summary computes nights from the two dates and multiplies by the selected room's nightly rate, with a fallback message until both dates and a room are chosen.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/hotel-room-booking.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/booking/booking7.tsx instead.
Usage
The file also exports booking7Demo, 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 { Booking7, booking7Demo } from "@/components/blocks/booking/booking7"; export default function Page() { return <Booking7 {...booking7Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Choose your room" | Section heading. |
| description | string | "Select a room, pick your dates, and see your total update instantly." | Supporting copy under the heading. |
| rooms | Booking7Room[] | none | List of selectable room types. |
| className | string | none | Extra classes for the outer section element. |
Types
interface Booking7Room { id: string; name: string; image?: { src: string; alt: string }; capacity: number; pricePerNight: number; }
Behavior notes
- Selecting a room card is real single-select useState, with the selected card getting a primary ring and border.
- The guest counter's +/- buttons are real useState, clamped between 1 and 6.
- Amenity icons (Wifi/Coffee/Snowflake) are hardcoded per room by array index, not passed as demo data, since icon components can't cross the client/server boundary as props.
- The total price is computed live by parsing the check-in and check-out date state strings with new Date(), taking the difference in nights, and multiplying by the selected room's nightly price. It falls back to 'Select dates' until both dates are set and check-out is after check-in.
- The 'Book now' button is decorative, no booking is actually submitted.
More Booking Blocks
View all →date-time-picker
Date & Time Picker
Split-panel scheduler: a real monthly calendar on the left, morning/afternoon time slots on the right, and a live booking summary footer.
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.