# Pricing Section

> A compact plans section for a landing page: plans with a Monthly / Yearly switch, a highlighted plan, checklists and a button each.

- Type: React block (Marketing Sections)
- Access: Pro (the source needs a Wingo UI Pro plan, see https://wingo-ui.com/pricing)
- Version: 1.0.0
- Install: `npx wingo-ui@latest add pricing-section`
- Docs: https://wingo-ui.com/components/pricing-section

## Interaction

Flip Monthly / Yearly (tap, drag the thumb, or arrow keys) and every price rolls to its new value while the line under it switches between billed monthly and billed yearly; the Yearly option carries a Save 20% pill worked out from the prices. The recommended plan stands out (raised, outlined or filled) with a Most popular pill and the solid button. Each plan's button follows its link, or runs onSelectPlan and shows a spinner while the returned promise is pending. Under the plans a Compare all features link leads to the full pricing page. In the cards layout a phone gets a swipeable rail that opens on the featured plan, with dots to jump between plans, or stacked cards; the split, minimal and single layouts stack into one column.

## Installation

```bash
npx wingo-ui@latest add pricing-section
```

Pro item: run `npx wingo-ui@latest login` once with a Pro account. The CLI adds the files, their dependencies and a version record for updates.

With shadcn: `npx shadcn@latest add @wingo-ui/pricing-section` (needs the @wingo-ui registry with your API key in components.json)

Files:

- `components/blocks/pricing-section.tsx`

npm dependencies: `npm i lucide-react`

Wingo UI dependencies (installed automatically):

- [Marketing Section](https://wingo-ui.com/components/marketing-section) ([Markdown](https://wingo-ui.com/components/marketing-section.md))
- [Badge](https://wingo-ui.com/components/badge) ([Markdown](https://wingo-ui.com/components/badge.md))
- [Button](https://wingo-ui.com/components/button) ([Markdown](https://wingo-ui.com/components/button.md))
- [Price](https://wingo-ui.com/components/price) ([Markdown](https://wingo-ui.com/components/price.md))
- [Segmented Control](https://wingo-ui.com/components/segmented-control) ([Markdown](https://wingo-ui.com/components/segmented-control.md))
- [useControllableState](https://wingo-ui.com/components/use-controllable-state) ([Markdown](https://wingo-ui.com/components/use-controllable-state.md))
- [Navigation](https://wingo-ui.com/components/navigation) ([Markdown](https://wingo-ui.com/components/navigation.md))
- [Tones](https://wingo-ui.com/components/tones) ([Markdown](https://wingo-ui.com/components/tones.md))
- [UIProvider](https://wingo-ui.com/components/ui-config) ([Markdown](https://wingo-ui.com/components/ui-config.md))

## Usage

```tsx
// app/(marketing)/page.tsx
"use client"

import Link from "next/link"
import { useRouter } from "next/navigation"
import { PricingSection } from "@/components/blocks/pricing-section"

export default function HomePricing() {
  const router = useRouter()
  return (
    <PricingSection
      linkComponent={Link}
      id="pricing"
      layout="cards"
      defaultPeriod="yearly"
      onSelectPlan={async (plan, period) => {
        const res = await fetch("/api/checkout", { method: "POST", body: JSON.stringify({ plan: plan.id, period }) })
        const { url } = await res.json()
        router.push(url)
      }}
    />
  )
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `eyebrow?` | `ReactNode` | `"Pricing"` | The small line over the title. |
| `title?` | `ReactNode` | `"Simple pricing that grows with your team"` | The section title. |
| `description?` | `ReactNode` | `"Start free and upgrade when you need more. Every plan includes unlimited tasks and docs."` | The paragraph under the title. |
| `actions?` | `ReactNode` |  | Buttons under the heading. |
| `plans?` | `PricingSectionPlan[]` | `"PRICING_SECTION_SAMPLE"` | The plans, in order: { id, name, description?, price: number \| { monthly, yearly } (per user per month, yearly as the monthly equivalent), badge?, featured?, featuresTitle?, features?: string[], cta?: { label, href? }, note? }. |
| `layout?` | `"cards" \| "split" \| "minimal" \| "single"` | `"cards"` | cards: plans side by side under the heading; split: the heading, switch and compare link on the side with the plans stacked next to it; minimal: one row per plan with its top three features, price and button; single: the featured plan in depth, with its features in a grid and the other plans in one line. |
| `align?` | `"start" \| "center"` | `"center"` | Where the heading, switch and footer sit in the cards, minimal and single layouts. split always starts them at the side. |
| `defaultPeriod?` | `"monthly" \| "yearly"` | `"monthly"` | The billing period shown first while uncontrolled. |
| `period?` | `"monthly" \| "yearly"` |  | The billing period, controlled. |
| `onPeriodChange?` | `(period: PricingSectionPeriod) => void` |  | Fires when the switch changes the period. |
| `showToggle?` | `boolean` | `true` | Shows the Monthly / Yearly switch. It hides by itself when no plan has a yearly price. |
| `featuredPlan?` | `string` | `""` | The id of the highlighted plan, and the plan the single layout shows. Empty uses the plan marked featured (Pro in the sample). |
| `featuredStyle?` | `"raised" \| "outline" \| "inverted"` | `"raised"` | How the featured plan stands out: raised floats higher and is a little taller, outline draws a ring in the tone, inverted fills it with the tone. |
| `mobileLayout?` | `"rail" \| "stack"` | `"rail"` | The cards layout below 768px: a swipeable snap rail that opens on the featured plan, with dots, or the cards stacked. |
| `showCompare?` | `boolean` | `true` | Shows the Compare all features link under the plans. |
| `compareHref?` | `string` | `"/pricing"` | Where the compare link goes, usually the full pricing page. |
| `animatePrice?` | `boolean` | `true` | Prices roll their digits on a period change. Reduced motion shows the new value at once. |
| `currency?` | `string` | `"USD"` | ISO 4217 code; amounts are in major units. |
| `locale?` | `string` | `""` | BCP 47 locale for the prices. Empty uses the UIProvider locale, then the browser's. |
| `tone?` | `"neutral" \| "brand" \| "success" \| "warning" \| "danger" \| "info"` | `"neutral"` | The featured plan's ring, fill, pill and button, and the checklist ticks. |
| `color?` | `string` | `""` | Any CSS color; replaces the tone. Leave empty to use the tone. |
| `savingsTone?` | `"neutral" \| "brand" \| "success" \| "warning" \| "danger" \| "info"` | `"success"` | The Save 20% pill on the Yearly option. |
| `radius?` | `"sm" \| "md" \| "lg"` | `"lg"` | Plan card corners: 12, 16 or 24px. |
| `background?` | `"none" \| "muted"` | `"none"` | muted sets the section on a gray band. |
| `spacing?` | `"none" \| "sm" \| "md" \| "lg"` | `"md"` | Vertical padding of the section. |
| `width?` | `"sm" \| "md" \| "lg" \| "xl"` | `"lg"` | The content column: 720, 960, 1200 or 1400px. |
| `onSelectPlan?` | `(plan: PricingSectionPlan, period: PricingSectionPeriod) => unknown` |  | Runs instead of following the plan's link (start a checkout); a returned promise keeps that button loading. |
| `linkComponent?` | `(props: LinkComponentProps) => ReactNode` |  | The router link for plan buttons and the compare link (next/link in an app); default the LinkProvider's. |
| `labels?` | `Partial<PricingSectionLabels>` |  | billingPeriod, monthly, yearly, save(percent), perMonth, billedMonthly, billedYearly, free, popular, included, otherPlans, plans, showPlan(name), compare and footnote (empty hides it). |
| `className?` | `string` |  | Classes for the <section>. |
| `classNames?` | `Partial<Record<PricingSectionSlot, string>>` |  | Classes for aside, toggle, list, plan, name, badge, description, price, billing, features, feature, cta, note, dots, footer and compare. |

## Parts

### PRICING_SECTION_SAMPLE (constant)

Acme's Free, Pro ($12, featured) and Business ($24) plans, 20% off yearly.

### DEFAULT_PRICING_SECTION_LABELS (constant)

The English strings.

### PricingSectionPlan (type)

One pricing plan card: id, name, price, badge, features, the call to action and a note.

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` |  | Stable key, also what featuredPlan matches. |
| `name` | `string` |  | The plan name. |
| `description?` | `string` |  | Who it is for, one line. |
| `price` | `number \| { monthly: number; yearly: number }` |  | Per user per month; yearly is the monthly equivalent when paid yearly. 0 reads as free. |
| `badge?` | `ReactNode` |  | A pill next to the name; the featured plan shows Most popular when left out. |
| `featured?` | `boolean` |  | The recommended plan. |
| `featuresTitle?` | `string` |  | A line over the checklist, e.g. "Everything in Free, plus:". |
| `features?` | `string[]` |  | The checklist. |
| `cta?` | `{ label: string; href?: string }` |  | The plan's button. |
| `note?` | `string` |  | A small line under the button. |

### PricingSectionProps (type)

Props of PricingSection.

## Examples

- **Cards with a filled featured plan**: Three plans side by side, Pro filled in the brand tone; a phone swipes through them on a rail.
- **Split**: The heading, switch and compare link stay on the side while the plans stack next to them; buttons start a pretend checkout.
- **Minimal rows**: One row per plan with its top three features, on a gray band, the featured row outlined.
- **Single plan**: Pro in depth: price, switch and button on the left, everything it includes on the right, the other plans in one line.
- **Two plans, stacked on phones**: Pro and Business only, Business recommended, cards stacked below 768px instead of a rail.

## See also

- [Pricing table](https://wingo-ui.com/components/pricing-table) ([Markdown](https://wingo-ui.com/components/pricing-table.md))
- [Pricing Page](https://wingo-ui.com/components/pricing-page) ([Markdown](https://wingo-ui.com/components/pricing-page.md))
- [Segmented Control](https://wingo-ui.com/components/segmented-control) ([Markdown](https://wingo-ui.com/components/segmented-control.md))
- [Price](https://wingo-ui.com/components/price) ([Markdown](https://wingo-ui.com/components/price.md))
- [Marketing Section](https://wingo-ui.com/components/marketing-section) ([Markdown](https://wingo-ui.com/components/marketing-section.md))

---

Canonical: https://wingo-ui.com/components/pricing-section
More components: https://wingo-ui.com/components · Index for agents: https://wingo-ui.com/llms.txt
