shadcn.io is not affiliated with official shadcn/ui
Usage Profile Pricing Block for React
A monthly estimate for Light, Standard and Heavy usage of a speech-to-text API: choosing a profile rolls the total, resizes a tall stacked bar of where the bill comes from and updates each cost line.
Installation
Overview
Answer "what will I pay?" with three profiles instead of a form. A Segment Group in the header row chooses Light, Standard or Heavy usage. Below it, one band between the page's rails shows where the bill comes from: a tall stacked bar whose segments resize to each cost's share (transcription, speaker labels, summaries), with a row under it for each cost line showing its rate, usage, share and amount. Beside the bar, a panel holds the estimate at display size, rolling with Sliding Number, a line saying who the profile sounds like, the block's one primary Shine Button and what the profile includes as outline Badges. On a phone that panel comes first, so the total and the button are the first things you see. The bar uses three tones of the theme's foreground colour so the button stays the only primary control. Built with Segment Group, Badge, Guides, Sliding Number, Shine Button and Lucide icons, with CSS transitions only. For metered APIs, where a visitor wants to see a typical bill, not a rate card.
FAQ
How do I change the profiles, rates and categories?
Edit CATEGORIES (a name, an icon, a rate per unit and the note that states it) and PROFILES (a name, a tagline, a usage count for each category and its features). Each cost is the usage times the rate, rounded to a whole dollar; the total is the sum of those, and each share is the cost over the total, so the bar, the rows and the headline always agree. Add a profile by adding an entry; the switch builds itself from the array.
How is the stacked bar built?
It is a row of spans with flex-grow set to each cost, so the segments always fill the bar and resize with a CSS transition when the profile changes. Its three tones are foreground at 100%, 50% and 20%, repeated as a dot beside each cost line. The bar is an image to assistive technology with a text alternative that lists each share, "Cost split: Transcription 62%, Speaker labels 21%, Summaries 17%".
Does the layout move when I switch profiles?
No. The button's label and the list of included features each hold every profile's text in one grid cell and show only the current one, so the panel keeps the size of the longest label and the tallest list. The number columns use tabular figures and fixed widths.
How do I connect the button to sign-up?
The button is a real link. It's a ShineButton with render set to an a element and nativeButton={false}. Add the chosen profile to the query, for example /signup?profile=standard, so your onboarding can start from the right quota.
Related
- 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
Cost Breakdown Pricing
CalculatorsAn 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
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
Metric Toggle Tiles Pricing
Charts and figuresThree plan tiles for a push-notification service under a large four-way quota switch: pick pushes, devices, segments or seats and every tile's headline figure rolls to that plan's limit. A snap carousel on phones.
- Pro
Treemap Quota Pricing
Charts and figuresThree platform plans, each led by a treemap whose tile areas show how its price splits across compute, memory, storage and bandwidth, over the price, a call to action and the quotas. A snap carousel on phones.
- Pro
Addon Builder Pricing
CalculatorsA CRM sold as a base plan plus six add-ons that switch on and off in cells sharing hairlines, with the price per seat rolling big beside them and a sticky total bar on phones.