Staaarter

Ride Booking

A rideshare-style booking form: pickup/dropoff address inputs, a real Now/Later toggle that conditionally reveals a real datetime picker, clickable ride class cards (Economy/Comfort/XL) with real single-select state and ETA/fare, and a static payment method list with a default badge.

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

npx shadcn add https://staaarter.com/r/ride-booking.json

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

Usage

The file also exports booking17Demo, 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 { Booking17, booking17Demo } from "@/components/blocks/booking/booking17";

export default function Page() {
  return <Booking17 {...booking17Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Request a ride"Section heading.
rideClassesRideClassOption[]noneSelectable ride class options with ETA and fare.
paymentMethodsPaymentMethodOption[]noneStatic list of payment methods to display.
classNamestringnoneExtra classes for the outer section element.

Types

interface RideClassOption {
  id: string;
  name: string;
  description: string;
  eta: string;
  fare: number;
  capacity: number;
}

interface PaymentMethodOption {
  id: string;
  label: string;
  detail: string;
  isDefault?: boolean;
}

Behavior notes

  • The Now/Later toggle is real client state; selecting "Later" conditionally renders a real native datetime-local input below it.
  • Ride class cards are real single-select client state: clicking a card selects it and applies a highlighted border/ring style.
  • The payment method list is static display only, nothing is clickable there.
  • The Confirm ride button is decorative only, no ride is actually requested.