Car Rental Booking
A car rental booking widget: pickup/return location and date fields, a photo grid of selectable car classes (each with seats/transmission specs and a daily rate), an insurance tier picker built from real radio inputs styled as cards, and an add-ons checklist. The price breakdown multiplies the selected car's and insurance tier's daily rates by the number of days between the two dates and adds any checked add-ons, falling back to a prompt when the dates aren't valid yet.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its media-slot, button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/car-rental-booking.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/booking/booking20.tsx instead.
Usage
The file also exports booking20Demo, 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 { Booking20, booking20Demo } from "@/components/blocks/booking/booking20"; export default function Page() { return <Booking20 {...booking20Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Reserve your rental car" | Section heading. |
| subheading | string | "Choose your dates, pick a class, and see the full price before you book." | Supporting copy under the heading. |
| className | string | none | Extra classes for the outer section element. |
Behavior notes
- Pickup/return location text inputs and the two date inputs are real controlled state.
- The car class grid (Compact/SUV/Luxury) is real single-select state: clicking a card selects it and highlights it with a ring, driving the daily rate used in the price calc.
- The insurance tier picker is three real native `input[type=radio]` elements styled as cards, real single-select state.
- The add-ons checklist (GPS, child seat, additional driver) is real native checkboxes backed by a Set of checked ids.
- The price breakdown parses the two date strings with `new Date(dateString)` to compute a day count, then multiplies the selected car's and insurance tier's daily rates by that count and adds checked add-on prices; it shows a fallback message when the dates don't form a valid range.
- The 'Reserve now' button is decorative only, no submission handler is wired since that would require a real backend.
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.