Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Dynamic Tiers Pricing Block for React

Graduated per-user pricing, explained: type a number of monthly active users and four stacked tier bands fill from the left, each showing its users times its rate, summed into the monthly bill.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Explain graduated pricing instead of asking buyers to trust it, with this dynamic tiers pricing section, shown here for Tollgate, an authentication service billed per monthly active user. A big number input sits in the header row beside the headline, with presets for 10K, 50K, 250K and 1M users. Under it, four tier bands sit in one ruled band between the page's rails, with + marks on its corners: the first 10,000 users free, then $0.02, $0.012 and $0.006 a user. Each band is a row with its range and rate, a bar that fills from the left as users land in it, and its users times its rate with the band's cost, so the bill is something you can add up by eye: the total sits on a tinted row below, rolling to each new amount with Sliding Number, beside the Shine Button call to action. The input formats as you leave it, the bars grow with a CSS transition, and on a phone each band's cost moves beside its name with the bar underneath. Built with Input, Field, Button, Sliding Number, Shine Button, Guides and Tailwind CSS, with CSS transitions only. For identity, messaging, analytics and any per-user product where the rate falls as volume rises.

FAQ

How do I change the bands and their rates?

Edit the TIERS array at the top of the file. Each band has an id, a label for its range, the from user it starts after, the to user it ends at (null for the last, open-ended band) and its rate in dollars per user; a rate of 0 shows "Free". Keep the bands in order and make each from the previous to. The cost of a band is the users inside it times its rate, worked out in whole cents, and the bill is the sum of the bands, so nothing else needs editing. PRESETS holds the shortcut buttons, MAX_USERS the most the input takes, and OPEN_SPAN how many users fill the last band's bar.

How does graduated pricing differ from volume pricing?

In graduated pricing each band is billed at its own rate, so the first 10,000 users stay free and the next 40,000 stay at $0.02 however large you grow: 120,000 users cost $0 + 40,000 × $0.02 + 70,000 × $0.012 = $1,640. In volume pricing the one rate for your total applies to every user, which makes a bill jump at each threshold. The bars show the difference: a user is only ever counted in one band.

How does the number input work?

It's a text field with a numeric keyboard on phones. It keeps digits only, takes up to seven of them, shows plain digits while you type so the caret never jumps, and groups them with commas once you leave it. The bands and the bill update as you type; presets set the field and the bill at once. The Input is named by its FieldLabel, and described by the note under the section that explains how users are counted.

What do screen readers hear?

The bands are an ordered list with an h3 for each range, then its rate, the cost and "40,000 × $0.02". The bars are decorative and hidden. The bill is read as "$1,640 per month", and a polite live region says "120,000 monthly active users cost $1,640 a month" once you leave the field, press Enter or pick a preset, not at every digit.

How do I connect the button to sign-up?

The call to action is a link, so point its href at your sign-up route; the free band means it can honestly say "Start with 10,000 free users". It's a ShineButton with render set to an a element and nativeButton={false}.

Do the bars and numbers work right to left?

Yes. The bars fill from the reading direction's start, the number input and every price stay left to right, so digits and the dollar sign keep their order, and the range labels and "× rate" lines are isolated so they don't reorder in Arabic or Hebrew layouts.

  • Pro

    A usage-based bill calculator for a search API: a slider over monthly search volumes sits in one short band, and a meter of what the plan covers and what is billed as overage rolls the estimated bill beside it.

  • Pro

    Per-seat pricing that falls across four team-size brackets, drawn as a descending bar chart beside compact rows with the saving on each bracket and a call to action per row.

  • Pro

    Tiered API Pricing

    Comparison tables

    API tiers by request quota, with the quota as the headline: four columns open with 10k, 250k, 2M and 10M+ requests a month at display size, then the price, the overage rate and a call to action, over grouped limits and features.

  • Pro

    An itemised monthly bill for an accounting suite: full-width ledger rows with quantities, a subtotal, the annual discount and the total, which a billing switch recalculates, beside the plan it adds up to.

  • Pro

    A receipt that prices itself, for a webhook-delivery service: number steppers for seats, events and days of history drive a live bill that stamps the cheapest plan and itemises what goes past its allowance.

  • Pro

    A seat calculator: a slider sets the team size with its count riding the thumb, ticks at the 10, 25 and 50 seat discounts, shortcuts to them, and a panel that rolls the seat price and monthly total.