Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Contrast Highlight Pricing Block for React

Three 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.

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

Draw attention to your recommended tier with this contrast highlight pricing section, shown for Nightjar IDE, a cloud development environment. The highlight follows the page theme, light in a light theme and dark in a dark one, and comes from structure rather than a dark fill. A header row holds the headline and a Segment Group billing switch, above three plans that share hairlines: a free tier and Teams as flat cells, and the Pro plan as the one raised card, lifted above the row by a shadow and a ring, a little taller, with an outline Recommended Badge and its price and button on a card inside the card. The band is ruled above and below with a + mark on each corner, inside the page's solid side rails. Each price rolls to its new amount with Sliding Number when the period changes, and every plan has a Shine Button and a feature list with neutral checks. Pro holds the only button in the primary colour. Below md a plan switch shows one plan at a time, Pro first and still raised, and each list folds after five features. Built with Guides, Segment Group, Sliding Number, Badge, Button, Shine Button and Lucide icons, with CSS transitions only. For developer tools, SaaS pricing pages and launches where the recommended plan should lead the eye.

FAQ

How do I change the plans and which one is highlighted?

Edit the PLANS array at the top of the file. Each plan has its monthly price, its annual price (the monthly amount when billed yearly), a description, features as a list of strings with a featureHeading above them, the call to action's cta and href, and an optional badge. Set highlight: true on the plan that becomes the raised card with the primary button, and set HIGHLIGHT_ID to its id so the phone switch starts there. A plan whose prices are 0 shows Free instead of a price. FOLDED is how many features a phone shows before "All N features".

How do I connect the plan buttons to checkout?

Each call to action is a real link to its plan's href. It's a ShineButton with render set to an a element and nativeButton={false}. Add the billing period to it, for example /checkout?plan=pro&billing=yearly, and let your server pick the matching price from your payment provider. The free plan can link straight to sign-up.

Does the highlight stay readable in every theme?

Yes. Nothing is a fixed colour and no plan takes a different theme scope. The raised cell uses the theme's own card colour with shadow-lg and a ring-foreground/15 ring, and its price and button sit on a bg-muted/50 panel inside it, so in a light theme it reads as a white card lifted off a flat row and in a dark theme as a lighter card with a visible edge. Its description and price line use the theme's muted text, its checkmarks the foreground, and its button is the theme's primary button. In a dark theme the shadow is quiet, so the ring carries the edge.

How does it look on a phone?

Below the md breakpoint a second switch named "Plan" shows one plan at a time, starting with the raised one, so its price and button come within the first screen. Each list shows its first five features and a ghost button, "All 7 features", that expands the rest and reads as expanded or collapsed to a screen reader. From md the three plans sit side by side, the switch is gone and every feature is shown.

Is the pricing section accessible?

The billing switch and the phone's plan switch are Segment Groups, radio groups named "Billing period" and "Plan": Tab reaches the selected option and the arrow keys move and select. Each price keeps its current amount in visually hidden text and isn't a live region, and "/user/mo" is read as "per user per month". Plans are h3 headings under the section's h2, and each call to action names its plan, as in "Start 14-day trial, Pro plan". The plans that aren't shown on a phone are hidden from the accessibility tree, so no focus lands on them.

When should I raise a plan instead of outlining it?

Raise it when one plan should clearly lead, such as the middle of three tiers: a lifted card draws the eye before any badge is read, without spending the primary colour on a surface or forcing a dark section on a light page. A badge alone is quieter and keeps the plans equal, which suits pages where several plans fit different visitors equally well. The lift is md:-my-4 with matching extra padding, so the content stays aligned with the other plans; drop both to keep the card level with the row.

  • 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

    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.

  • Pro

    Annual Savings Pricing

    Billing switches

    Three plans that show what yearly billing saves: each plan's head holds two bars, twelve monthly payments against one yearly payment, with the saving printed in the gap, under a monthly and yearly switch.

  • Pro

    Countdown Offer Pricing

    Discounts and offers

    A launch price on a clock: a live countdown in days, hours, minutes and seconds at display size beside the headline, over three plans for a music app, one of them discounted. A Segment Group shows one plan at a time on a phone.

  • 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.