shadcn.io is not affiliated with official shadcn/ui
Per Transaction Pricing Block for React
Per-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.
Installation
Overview
Show transaction-based pricing plainly with this per-transaction rate sheet. A left-aligned headline states that there is no monthly fee and no setup cost; beside it, in the same header row, a Segment Group switches between the United States, Europe and the United Kingdom, and a Shine Button starts the sign-up. Each payment type, domestic cards, international cards, digital wallets and bank debits, is a compact row between hairlines with its name, a one-line description and its percentage at display size, followed by its fixed fee or, for bank debits, the cap on one transaction. Percentages and fees roll to the region's rates and currency with Sliding Number and line up in two columns. A last band holds a checklist of what every transaction includes beside the volume discount threshold and the billing currency, split by one vertical rule. The rows end at the page column's rails and the block's top rule is the Guides spine, so it stacks under any other block. Built with Guides, Segment Group, Sliding Number, Shine Button, Lucide icons and Tailwind CSS, with CSS transitions only. For payment processors, marketplaces, point-of-sale products and any platform that charges per transaction.
FAQ
How do I change the regions and rates?
Edit the constants at the top of the file. PAYMENT_TYPES lists the rows, each with its name and description. REGIONS lists the switch's options, each with its label, a short label for phones, currency code, symbol and rates: for every payment type a percent and a fixed fee in the region's currency, where 0 shows "no fixed fee", and an optional cap, the most one transaction can cost, which shows as "capped at" when there is no fixed fee. INCLUDED is the checklist, and DISCOUNT_FROM the monthly volume, in thousands, above which discounts apply.
Why does the bank debit rate show 0.80% in the United States?
Each row keeps the same number of decimals in every region, the most any region needs: bank debits cost 0.35% in Europe, so the row shows two decimals everywhere (0.80%, 0.35%, 0.50%) and the card rows show one (2.9%, 1.5%). Switching regions then rolls the digits in place instead of adding or removing one, so the row doesn't jump.
Is the region switch accessible?
Yes. The switch is a SegmentGroup, a radio group named "Pricing region": Tab reaches the selected region and the arrow keys move and select. On a phone its labels shorten to US, EU and UK, and the accessible name follows what is shown. The rates are a list of h3 rows under the section's h2, each rolling number keeps its current value in visually hidden text, and the rates aren't a live region, so switching doesn't read four rows aloud.
How do I open the sheet on the visitor's region?
The selected region is the value state, which starts at "us". Start it from your own data instead, such as the country your server detects from the request or the visitor's saved preference, passed in as the initial state. Keep the switch visible either way, since a business's region isn't always where its visitor is.
How does the sheet fit on a phone?
The header stacks: the headline and sentence, then the region switch, then the button, so the call to action stays within the first screen. Each row stacks its name and description over its rate, and the checklist goes from two columns to one. From the sm breakpoint each row puts its text on the left and its rate on the right, and from lg the checklist and the volume note share the last band, split by a vertical rule.
When should I charge per transaction instead of a subscription?
Charge per transaction when your revenue should follow your customers' sales: payment processing, marketplaces and point-of-sale, where a small seller pays little and a large one pays more. Charge a subscription when the product's value doesn't depend on payment volume, and consider a small platform fee on top of reduced rates for high-volume customers.
Related
- Pro
Pay As You Go Pricing
Usage and creditsUsage 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.
- %%%%Pro
Platform Fee Pricing
Sales and partnersA maker marketplace's take rates in four ruled tier rows: each percentage at display size over a bar that shrinks with it, with the plan fee, the sales it pays off from and the payout speed.
- Pro
Region Pricing
Billing switchesInfrastructure pricing by region for a container host: a grid of six regions with each one's latency and price per hour, where choosing one re-prices the call to action beside it and the three instance sizes under it.
- Pro
Rate Matrix Pricing
Comparison tablesA rate matrix for a messaging API: four plans as columns with their base price and call to action first, then each metered unit as a row of allowance and overage rate, then platform and support rows.
- 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
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.