shadcn.io is not affiliated with official shadcn/ui
Pricing With FAQ Block for React
Plans answered by the pricing FAQ for an e-commerce builder: a compact plan list, a row each with its name, price and call to action, beside an accordion of six questions with the first one open, in one ruled band.
Installation
Overview
Answer the questions that stop a purchase right where buyers decide, with this pricing section and FAQ, shown for Cartwheel Store, an e-commerce builder. One band, ruled above and below with a + mark on each corner, holds two columns. The first is a compact plan list: a row each for Shop, Grow and Scale with the plan's name, a line of limits, a price that rolls to its new amount with Sliding Number when the Segment Group in the header row switches between monthly and yearly, and a Shine Button. Grow is tinted, carries an outline Best value Badge and the section's one primary button. The second is six questions about trials, fees, products, domains, migration and changing plans in an Accordion, the first one open, each marked with a plus that turns into a cross. Below md a plan switch shows one plan at a time, Grow first, and the questions follow. Built with Badge, Segment Group, Sliding Number, Accordion, Shine Button, Guides and Lucide icons, with CSS transitions only. For SaaS pricing pages that want to handle objections without sending buyers to a help page.
FAQ
How do I change the plans and the questions?
Edit the arrays at the top of the file. Each entry in PLANS has its name, description, a line of facts (the limits that matter), monthly and annual prices (annual is the monthly amount when billed yearly), the call to action's cta and href, and featured for the tinted row and its Best value badge; FEATURED_ID is the plan the phone switch starts on. Each entry in QUESTIONS has an id, the question and its answer; put the objection that costs you the most sales first, and set OPEN_QUESTION to its id so it opens by default. CONTACT_HREF is where "Talk to our team" goes.
How do I open another question first, or several at once?
OPEN_QUESTION to another question's id, or pass an empty array to defaultValue to start with all of them closed. Add multiple to Accordion to let several stay open at once.As it stands, opening a question closes the one before.How do I connect the plan buttons to checkout?
Each call to action is a real link to its plan's href, and the contact link one to CONTACT_HREF. The buttons use render with an a element and nativeButton={false}. Add the billing period from the switch's state to the address, such as /signup?plan=grow&billing=yearly, and map the plan and period to your payment provider's price on your server.
Is the FAQ accessible?
Yes. Each question is a button inside a heading that says whether its answer is expanded and which region it controls, so a screen reader can list the questions by heading and open one with Enter or Space. The arrow keys move between questions, and Home and End jump to the first and last. The plus icon is decorative. The billing switch and the phone's plan switch are radio groups named "Billing period" and "Plan", plans are h3 headings under the section's h2 and each call to action names its plan, as in "Choose Grow, Grow plan".
How does the layout adapt to small screens?
From the lg breakpoint the plan list and the questions sit side by side in the band, and each plan row is its name and limits, its price and its button in one line. Below lg they stack, plans first. Below md a switch named "Plan" shows one plan at a time, the featured one first, and the row stacks: name, price, then a full-width button, so the button is within the first screen and a half. The line under each price keeps the room of its longer text, so changing the period doesn't move the buttons.
When should I put the FAQ next to pricing instead of on its own page?
Put it next to pricing when a handful of questions (trials, fees, domains, switching plans) decide whether someone buys: the answer is there at the moment of doubt, and the questions are kept short enough not to bury the plans. Keep a separate help page for product how-tos and anything longer than six questions.
Related
- Pro
Billing Toggle Pricing
Billing switchesThree 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
Three Columns Pricing
Plan cardsThe 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
Accordion Plans Pricing
Plan rowsThree 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.
- Pro
Contrast Highlight Pricing
Plan cardsThree plans for a cloud IDE in one hairline band, with a contrast highlight that follows the theme: the recommended plan is one raised card among flat cells, with a free tier, prices that roll under a monthly and yearly switch, and a plan switch on phones.
- Pro
Pricing With Guarantee
Proof and guaranteesA free trial with a refund window drawn as a timeline: today, day 12, day 14 and day 30 on one line, beside the yearly plan, its price and call to action. It turns vertical on a phone.
- Pro
Comparison Table Pricing
Comparison tablesFour 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.