Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Accordion Plans Pricing Block for React

Three plan rows for an email API, each its own band with its price and call to action in view, opening in place to list its features, with a monthly and annual switch in the header row.

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

Show every plan in a few lines and open only the one a buyer cares about with this accordion pricing section, shown here for Mailcrate, a transactional email API. A compact header row puts the headline and one sentence on the left and a Segment Group billing switch on the right, so the first screen is the plans. Three rows follow, each its own band between the page's solid side rails, under the spine's top rule with its + marks: a row shows its name, how many emails a month it sends and what 1,000 more cost, its price and a Shine Button call to action, and an Accordion opens it in place to list five features under a heading that says what the plan adds. Prices roll to their new amount with Sliding Number when the period changes; the Volume row is open by default, tinted, carries an outline Most teams Badge and holds the only primary button. On wide screens the rows share their columns, so prices and buttons line up. Built with Accordion, Badge, Segment Group, Sliding Number, Shine Button, Guides and Lucide icons, with CSS transitions only. For developer tools, usage-sized plans, mobile-first pricing pages and any page where vertical space is tight.

FAQ

How do I change the plans, prices and feature lists?

Edit the PLANS array at the top of the file. Each plan has its name, a description line (here the monthly volume and the price of 1,000 more emails), its monthly price, its annual price (the monthly amount when billed yearly, 20% off here), an optional badge, featured for the tinted row with the primary button, the featureHeading over its list, its features (plain strings, one checkmark each) and the call to action's cta and href. Five features per plan keep the open row short. CURRENCY is the symbol written before each price, and the "−20%" hint in the switch is plain text to change with the discount.

How do I choose which plan opens first, or let several open at once?

The Volume row opens on load because the Accordion starts with its id. Change defaultValue={["volume"]} to another plan's id, or to [] to start with every row closed; add multiple to let several rows stay open.

How do I connect the plan buttons to checkout?

Each call to action is a real link to its plan's href: point it at your checkout or sign-up route with the plan and the billing period, for example /checkout?plan=volume&billing=annually, and let your server map them to your payment provider's price. It's a ShineButton with render set to an a element and nativeButton={false}.

Is the accordion pricing section accessible?

Yes. Each row's name, badge, feature count and description are one button inside a heading, so a screen reader lists the plans as headings and announces whether each is expanded; Enter or Space opens and closes it. The price and call to action sit outside that button, so they're reached and read on their own: each price keeps its amount in visually hidden text with "per month", and each call to action names its plan, as in "Start 14-day trial, Volume plan". The billing switch is a radio group named "Billing period": arrow keys move and select.

How do the rows line up, and how do they fit a phone?

From the sm breakpoint the rows share three columns through CSS subgrid (plan, price, call to action), so the prices end on one line and the buttons take the width of the longest label, with no fixed widths; a closed row is about 80 px tall on a desktop. On a phone each row stacks: the plan first, then its price with the button beside it, and the button moves under the price when the screen is too narrow for both, so the Volume button sits within the first screen and a half. An open row lists its features in one column on a phone, two from sm and three from lg. The digits are tabular, so switching the period doesn't move anything, and under reduced motion the prices change in place.

When should I use accordion pricing instead of side-by-side cards?

Use accordion pricing when vertical space is tight or plans have long feature lists: in a modal, a sidebar or a mobile-first page, visitors compare names and prices at a glance and open only the plan they care about. Use side-by-side cards or a comparison table when buyers need every plan's features in view at once to compare them line by line.

  • Pro

    The densest price list: a type foundry's six licenses set like a menu in mono, each row a name, what it covers and dot leaders running out to its price, with a buy button.

  • Pro

    A fanned deck of plan cards for a flashcard app: the chosen plan's card in front with its price, button and features, the other two peeking out behind, brought forward by a tab list.

  • Pro

    Billing Toggle Pricing

    Billing switches

    Three plan cards under a monthly and yearly switch that wears its saving in the header row, with prices that roll to their new amount and each plan a card in a card.

  • Pro

    The canonical three-column pricing section for a team knowledge base: Personal, Team and Company cells under a monthly and yearly switch, each outlined by hairlines that overshoot its corners, the recommended plan raised, one plan at a time on phones.

  • Pro

    Comparison Table Pricing

    Comparison tables

    Four plans compared feature by feature in one table whose hairlines meet the page rails, with a billing switch, a tinted popular column and, on a phone, a plan switch that keeps the feature column beside one plan.

  • Pro

    One plan in the spotlight: an oversized card under a monochrome cone of light with the price as the largest type on the page, a monthly and yearly switch, and a short pitch beside it.