ComponentsData display

Tier pricing

Quantity breaks: a unit price that drops at set quantities, the tier the current quantity falls in highlighted, the unit price and total, and how many more units reach the next price. A table with range, unit price and saving, or a ladder of descending steps; tiers can set the quantity.

components/tier-pricing.tsxtheme · material · accent · density · font
Price per case by quantity
QuantityPrice per caseSaving
Your price$52.00—
$48.00−8%
$45.00−13%
$41.50−20%
8 × $52.00Total$416.00

2 more for $48.00 per case.

Installation

$ pnpm add @vamos-ui/react

The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";

Usage

import { TierPricing } from "@vamos-ui/react";

<TierPricing
  unit="case"
  tiers={[{ min: 1, price: 52 }, { min: 10, price: 48, label: "Trade" }, { min: 60, price: 41.5, label: "Pallet" }]}
  quantity={cases}
  onQuantityChange={setCases}
  quantityInput
/>

The active tier carries aria-current and a "Your price" tag in text, not only the highlight.

The next-break hint is a polite live region, so changing the quantity announces "8 more for $45.00 per case."

Examples

Ladder

variant="ladder": descending steps; each step is a button that jumps to its minimum.

Price per label by quantity
240 × $2.10Total$504.00

You save $72.00.260 more for $1.85 per label.

API

TierPricing

PropTypeDefault
tiers
{ min, price, label? }. Sorted by min; a tier runs to the next min − 1, the last is open-ended.
PriceTier[]—
quantity / defaultQuantity / onQuantityChange
With onQuantityChange (or quantityInput) every tier sets the quantity to its minimum.
number—
quantityInput / maxQuantity
A number field for the quantity.
boolean / number—
variant
Rows or descending steps.
"table" | "ladder""table"
unit
Unit word in the texts: case, box, seat.
stringlabel "unit"
formatPrice / currency
Default: provider currency, two fraction digits.
(n) => string / string—
showSaving / showSummary
Saving column (against the first tier) and the quantity × price, total and next-break line.
booleantrue
labels
Dictionary namespace "tierPricing": caption, quantity, range, rangeOpen, unitPrice, saving, current, line, total, next, best, minimum, saved, setQuantity, unit.
Partial<TierPricingLabels>—

tierQuote(tiers, quantity)

PropTypeDefault
returns
{ index, tier, next, more, unitPrice, total, saved } — for order lines, carts and server checks.
TierQuote—