# Pricing Plans

> A React pricing section with a monthly or yearly switch that rolls prices to the new value, a featured ink plan, and feature rows marked included or not.

- Kind: Block (Billing)
- Docs: https://ui.minidev.pro/docs/pricing-plans
- Source (registry JSON with the full file): https://ui.minidev.pro/r/pricing-plans.json
- License: MIT. One file, yours to edit after install.

## When to use

Use on a marketing or /pricing page with two to four plans. Prices are numbers per month; the yearly figure is the monthly-equivalent price and the "Billed $X yearly" line is derived. A price of 0 reads "Free". For an existing customer's plan and invoices use BillingPage; for a premium animated variant use PricingMotion. Period is uncontrolled by default; pass `period` + `onPeriodChange` to control it.

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/pricing-plans
```

Writes `components/ui/pricing-plans.tsx` plus the MiniDev files it is built from (button, number-roll, segmented-control) and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/pricing-plans.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

```tsx
import { PricingPlans } from "@/components/ui/pricing-plans"
```

From the npm package:

```tsx
import { PricingPlans } from "minidev-ui-kit/blocks/pricing-plans"
```

## Usage

```tsx
import { PricingPlans } from "@/components/ui/pricing-plans"

export function Example() {
  return (
    <PricingPlans />
  )
}
```

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `eyebrow` | `string` | `"Pricing"` | no | Small mono label above the title. Empty string hides it. |
| `title` | `React.ReactNode` | `"Priced like a tool, not a hire."` | no | Section heading (rendered as h2). |
| `description` | `React.ReactNode` | `"Per seat, per month. Change plans an...` | no |  |
| `plans` | `Plan[]` | `DEFAULT_PLANS` | no | Plans in display order. Defaults to Lumen's Starter, Team and Scale. |
| `currency` | `string` | `"USD"` | no | ISO 4217 code used to format prices, e.g. "USD", "EUR". |
| `yearlyBadge` | `string` | `"-20%"` | no | Discount badge on the yearly option. |
| `onSelect` | `(plan: string, period: BillingPeriod) => void` | - | no | Called with the plan name and the selected period when a plan's button is pressed. |
| `period` | `BillingPeriod` | - | no | Controlled billing period. |
| `defaultPeriod` | `BillingPeriod` | `"yearly"` | no | Initial billing period when uncontrolled. |
| `onPeriodChange` | `(period: BillingPeriod) => void` | - | no | Called when the period switch changes. |
| `unit` | `string` | `"/ seat / mo"` | no | Price suffix, e.g. "/ seat / mo" or "/ mo". |
| `per` | `string` | `"per seat"` | no | Used in "Billed $X per seat yearly". Empty string drops it. |
| `className` | `string` | - | no |  |

## Keyboard interactions

| Key | Action |
| --- | --- |
| `Tab` | Moves to the selected option of the period switch, then to each plan's button. |
| `ArrowLeft` or `ArrowRight` | In the switch, moves to the other period and selects it. ArrowUp and ArrowDown do the same. |
| `Home` or `End` | In the switch, selects Monthly or Yearly. |

## Accessibility

- The section is labelled by its `<h2>` title through `aria-labelledby`; each plan is an `<article>` with an `<h3>` name.
- Each feature list has `aria-label` "{plan} features". Excluded features add screen-reader text "(not included)", and the check and dash icons are `aria-hidden`.
- Prices use NumberRoll, which keeps a screen-reader-only copy of the formatted price and swaps digits without rolling under reduced motion.

## FAQ

### How do I control the billing period, or know it when a plan is chosen?

Uncontrolled, it starts at `defaultPeriod` (`"yearly"`). Pass `period` and `onPeriodChange` to control it. `onSelect(plan, period)` receives the plan name and the period showing when the button was pressed.

### How do I show a free plan or a feature a plan lacks?

A price of `0` renders "Free" with no unit and the line "Free forever for one person", which is fixed text. In `features`, a string is included and `{ label: "Alerts", included: false }` renders muted with a dash.

### Is `yearly` the annual price?

No, it is the monthly-equivalent price. The "Billed $468 per seat yearly" line is `yearly * 12` formatted with `currency`. Set `per=""` to drop "per seat", and `unit` to change "/ seat / mo".

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`
- Built from: [button](https://ui.minidev.pro/docs/button/md), [number-roll](https://ui.minidev.pro/docs/number-roll/md), [segmented-control](https://ui.minidev.pro/docs/segmented-control/md)

## Related

- [Billing Page](https://ui.minidev.pro/docs/billing-page/md): A Tailwind workspace billing page with three plan cards and a highlighted Pro tier, a seat usage meter, and an invoice list with paid and void statuses.
- [Pricing Motion](https://ui.minidev.pro/docs/pricing-motion/md): Pricing plan cards that fade up in sequence on scroll, each with name, price, blurb, feature bullets and a choose button, plus an accent featured plan.
- [Commerce Checkout](https://ui.minidev.pro/docs/commerce-checkout/md): A two column React checkout page with an editable cart line item, a shipping address form, and an order summary with subtotal, tax, total and a pay button.
- [Marketing Landing](https://ui.minidev.pro/docs/marketing-landing/md): A complete Tailwind landing page assembled from a hero with two actions, a logo cloud, a stats strip, a three column feature grid and a closing CTA banner.
- [Add Card Form](https://ui.minidev.pro/docs/add-card-form/md): Compact payment form for card number, expiry and CVC with correct autocomplete hints, numeric input mode and a full width save button. Ready for your processor.
- [Billing Address](https://ui.minidev.pro/docs/billing-address/md): Tailwind billing address fieldset with a multiline street field and a responsive row for city, state and postal code. Drops into checkout forms.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
