Staaarter

Team Discount Calculator

A quantity stepper for team seats with tiered discount logic (e.g. 1-4 seats: no discount, 5-9: 10% off, 10-19: 20% off, 20+: 30% off) computed inline from the quantity. A live summary shows subtotal, discount amount, and final total as the quantity changes. Perfect for group ticket sales and team registrations.

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/team-discount-calculator.json

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

Usage

The file also exports event6Demo, 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 { Event6, event6Demo } from "@/components/blocks/event/event6";

export default function Page() {
  return <Event6 {...event6Demo} />;
}

Props

PropTypeDefaultDescription
eyebrowstring"Group pricing"Small label above the heading.
headingstring"Team Discount Calculator"Section heading.
descriptionstring"Bringing your team? The more seats you add, the more everyone saves."Supporting copy under the heading.
pricePerSeatnumbernoneBase price per seat before any discount is applied.
tiersDiscountTier[]noneOrdered discount tiers keyed by minimum quantity.
classNamestringnoneExtra classes for the outer section element.

Types

interface DiscountTier {
  minQuantity: number;
  label: string;
  /** e.g. 0.1 = 10% off */
  rate: number;
}

Behavior notes

  • The quantity stepper is real client-side state (useState<number>, clamped to a minimum of 1) — the +/- buttons directly change the seat count.
  • The active discount tier, subtotal, discount amount, and total are all derived inline during render from the quantity state, no useEffect involved.
  • The Continue to registration button is decorative and has no real checkout handler wired up.