shadcn.io is not affiliated with official shadcn/ui
Treemap Quota Pricing Block for React
Three 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.
Installation
Overview
Show how each plan divides its resources with this treemap quota pricing section, shown here for Stratus Run, an application platform. A compact header row has the title on the left and a four-swatch legend on the right, over three plans in cells of one hairline band rather than separate cards. Each cell leads with a treemap where the area of every tile is that resource's share of the plan's price across compute, memory, storage and bandwidth, so Starter is mostly compute while Scale leans on storage and bandwidth. The tiles settle in one after another on first paint, each labelled with its resource and quota, and the price and a Shine Button call to action come straight after the treemap, before a quota list that repeats the figures and shares as plain text and the plan's features. The recommended Growth plan is a lightly tinted cell with an outline Most popular Badge and the only filled button, so the theme's colour marks one action. Below lg the plans become a snap carousel, Growth first, with the next card peeking and dots that name each plan. The section sits on the page's drafting lines, drawn by Guides: rails that continue into the blocks above and below, a rule along the top with a + mark on each crossing, and the band's rules overshooting the rails with a + mark at each corner. Built with Data List, Badge, Guides, Shine Button and Lucide icons, with the treemap drawn in HTML from the theme's text colour and CSS transitions only. For infrastructure platforms, cloud compute products and any resource-heavy SaaS where buyers weigh quota trade-offs at a glance.
FAQ
How do I change the resources, quotas and plans?
CATEGORIES lists the four resources, each with its label and a tone from the TONES ramp. PLANS holds the plans: each has an allocations entry per resource with the display text written on its tile and in the quota list, and the dollars of the plan's price that go to that resource. The price is the sum of a plan's dollars, so change both together. Each plan also has its tagline, cta, href and features, and popular adds the tint, the Most popular badge and the filled button.
How is the treemap laid out?
With slice and dice. The largest resource takes a slice across the longer side of the treemap, the next takes a slice across the longer side of what remains, and the last fills the rest, so every tile's area is its dollars' share of the plan. The layout is worked out once from the data when the module loads, as percentages, so the treemap scales with its cell and needs no measuring. The treemap is a fixed 176 px tall and as wide as its cell; the areas stay true at any width.
What does a screen reader hear for a treemap?
Each treemap is one image named with the plan's split, for example "Growth plan, share of the price by resource: Compute 8 vCPU, 40%; Memory 32 GB, 21%; …", so the tiles aren't read one by one. The quota list under it is a real description list of each resource, its quota and its share, the price is read as "$95 per month", and each call to action carries its plan's name ("Start free trial, Growth plan"), so two links with the same text stay distinct.
What happens to labels on small tiles?
Every tile is a size container. When a tile is narrower than about 56 px its resource name hides and the quota stays, so the text never spills out of the tile; the legend's tones, the quota list below and the image's name still identify every resource. The tiles' colours are a ramp of the theme's text colour, from solid to faint, each with a label colour that keeps AA contrast in light and dark mode and in every preset.
How does the carousel work on a phone?
Below lg the plans sit in a row you swipe sideways, each card snapping to the middle, the popular plan first and the next card peeking so it's clear there's more. The dots under it are buttons named for each plan: the one in view is marked and pressing another scrolls its card into view, smoothly unless the visitor prefers reduced motion. Each card keeps the treemap, the price and the button together, so the call to action is within the first screen and a half. From lg the three cards are a row of cells.
How do I connect the plan links to checkout?
Each call to action is a real link. It's a ShineButton with render set to an a element and nativeButton={false}. Set each plan's href to your checkout or sign-up route with the plan in the query, for example /signup?plan=growth. The treemap is display only and has no effect on billing.
Related
- Pro
Radar Chart Pricing
Charts and figuresThree database plans, each led by a radar chart of six capability scores that shows the plan's shape at a glance, over its price, call to action and real limits. A snap carousel on phones.
- Pro
Headroom Bars Pricing
Usage and creditsOne card of capacity bars for an uptime monitor: each grows from a Free limit to Pro's, with a chip counting how many times more Pro gives, and the upgrade button at the card's top right.
- 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
Usage Profile Pricing
CalculatorsA 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.
- Pro
Storage Plans Pricing
Charts and figuresThree archival storage plans as cells of one ruled band, each led by an oversized capacity figure with restore time and free restores under it, prices that roll on a monthly and annual switch.
- 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.