shadcn.io is not affiliated with official shadcn/ui
Pay As You Go Pricing Block for React
Usage pricing for a serverless platform as rate rows: each billable resource with its free allowance, its starting rate at display size and the two volume steps that lower it, with one call to action in the header.
Installation
Overview
Show transparent usage-based pricing with this pay-as-you-go rate table. A compact header, a heading, one sentence and the section's only call to action, a Shine Button on the right, sits under the page's top rule and side rails, drawn by Guides with a + mark on each corner of the list below. Four billable resources, invocations, duration, data transfer and log storage, are rows between two hairlines, each with its name and unit, its free allowance each month, and three rates: the starting rate at display size, and the two cheaper volume steps with the range each covers. Columns are labelled once across the top; on a phone every cell carries its own label and the rates sit two by two, so nothing scrolls sideways. Built with Shine Button and Guides, as one list in a server component, with CSS transitions only. For serverless, API and cloud pricing, metered developer tools and any consumption product with a free tier and volume discounts.
FAQ
How do I change the resources, allowances and rates?
Edit the RESOURCES array at the top of the file. Each resource has its name, the unit a rate buys ("per 1M requests"), its monthly free allowance as an amount and a unit, and three steps: the starting rate and the two volume steps, each a range label and a rate in dollars per unit. A rate is written with at least two decimals and as many more as it needs, so $0.20 and $0.0000166 both read right. COLUMNS holds the four column names; to show more steps, add one to each resource and one column.
How do I connect the rates to metered billing?
Give each resource a metered, graduated price in your billing system, with the free allowance as a first tier at zero and one tier per step. Report usage from your platform as it happens, and let the billing system apply the tiers at the end of the period. The call to action is a real link: point its href at your sign-up route, since nothing is charged until usage passes a free tier.
How does a screen reader read the rates?
Each resource is a list item headed by its name as an h3, followed by a description list of its four values. Every value is a term and its description ("Starting rate", "$0.20, 1M to 100M"), so it reads the same on a phone and on a desktop: from md the terms are visually hidden and the column labels above the list, which are decoration, take their place. The header's button is a plain link.
How does the list fit on a phone?
Below the md breakpoint each row is a heading over a two-by-two grid: the free allowance and the starting rate, then the two volume steps, each with its own label above it. There is no minimum width and no sideways scrolling. The call to action stays in the header, full width under the sentence, so it is on the first screen.
Do the figures work in a right-to-left layout?
The rows mirror: the plan name moves to the right and the steps run right to left, in the order the sentence reads. Rates are always written left to right (dir="ltr"), so $0.0000166 keeps its sign, point and digits in order, and ranges and units are isolated with bdi so their numbers and letters don't reorder.
When should I show usage pricing as rows instead of a table or cards?
Use rate rows when you bill on three or more resources and the rates and their steps are what visitors compare: the starting rate is the number to find, so it is the biggest. Use a usage slider with an estimate when visitors care more about a monthly total than about unit rates, and plan cards when each resource needs a longer explanation.
Related
- Pro
Tiered API Pricing
Comparison tablesAPI 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
Volume Discount Pricing With a Descending Chart
Seats and teamsPer-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
Usage Slider Pricing
CalculatorsA 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 Transaction Pricing
Sales and partnersPer-transaction rates for a payments processor as ruled rows, each percentage at display size with its fixed fee or cap, and a region switch and call to action in the header row.
- Pro
Overage Pricing
Usage and creditsOverage pricing drawn as an area chart: pick a plan and see its monthly bill against the gigabytes ingested, a flat shaded block for the allowance and a rising wedge for every extra gigabyte, beside the price and a table of allowances.
- Pro
Credit Packs Pricing
Usage and creditsOne-time credit packs where the amounts lead: 500, 2,000, 10,000 and 50,000 credits at display size over growing coin stacks, each pack cheaper per credit, rows with a buy button on phones.