Staaarter

Ticket Selection Cart

A multi-ticket-type selector: each ticket tier has its own quantity stepper, a per-tier price, and a static availability note. A cart summary sums every tier's quantity × price into a live total. Perfect for event ticketing with multiple pass options.

By Staaarter Team
Event
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/ticket-selection-cart.json

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

Usage

The file also exports event7Demo, 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 { Event7, event7Demo } from "@/components/blocks/event/event7";

export default function Page() {
  return <Event7 {...event7Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstring"Get your pass"Small label above the heading.
headingstring"Ticket Selection Cart"Section heading.
descriptionstring"Pick a ticket type for each attendee. Your total updates as you go."Supporting copy under the heading.
tiersTicketTier[]noneTicket tiers available for purchase.
classNamestringnoneExtra classes for the outer section element.

Types

interface TicketTier {
  id: string;
  name: string;
  price: number;
  /** Static demo copy, e.g. "42 left". */
  availability: string;
  description?: string;
}

Behavior notes

  • Each tier's quantity is real client-side state (a single useState<Record<string, number>> keyed by tier id) — the +/- buttons directly change that tier's count, clamped at 0.
  • The cart total and ticket count are derived inline during render by summing quantity × price across every tier.
  • The Checkout button is decorative (disabled at zero tickets as a UI affordance, but has no real submit handler wired up).