# Pricing Plans (Lumen Halo): prompt.md (v1.0.0)

- id: `lumen-pricing-plans` · version 1.0.0 · block · pro (Pro)
- category: Marketing
- build: Base UI (one set of files; its dependencies follow the build)
- install (this build): `npx shadcn@latest add @beautiful-ui-pro/lumen-pricing-plans`
- npm dependencies: none
- registry dependencies: utils, @beautiful-ui/lumen-button, @beautiful-ui-pro/lumen-billing-toggle, https://beautiful-ui.dev/r/lumen-foundation.json
- docs: https://beautiful-ui.dev/components/lumen-pricing-plans
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

Plan cards and the table that compares them. The billing switch rolls every price to the new amount, one plan can be marked as the pick, and a plan can be Contact us. The comparison keeps plan names in view while you scroll and becomes a list per plan on phones.

## Build it
- Stack: React 19 (`ref` is a plain prop), TypeScript, Tailwind CSS v4 utilities, a shadcn-initialised project with the `@/*` alias.
- Packages: none beyond React.
- Files: `components/ui/lumen/blocks/pricing-plans.tsx`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `lumen-button`, `lumen-billing-toggle`, `lumen-foundation`.
- Builds: one set of files for both, but its dependencies come in Base UI and Radix builds. Install the one that matches the project (see Install): a free item's bare URL installs the Base UI build of it and its dependencies.
- Exports to keep: `PricingPlans`, and every exported type.
- CSS: the install merges this item's rules (the registry `css` field) into your global stylesheet, in `@layer components`, and adds the lumen foundation (tokens, keyframes, motion levels) once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Tokens: retheme with the `--lumen-*` custom properties (`--lumen-accent`, `--lumen-accent-foreground`, `--lumen-accent-text`, `--lumen-bad`, `--lumen-bad-text`, `--lumen-chart-accent`, `--lumen-chart-accent-foreground`, `--lumen-chart-accent-text`, `--lumen-focus`, `--lumen-good`, `--lumen-good-text`, `--lumen-hairline`, `--lumen-ink`, `--lumen-muted-ink`, `--lumen-series-1`, `--lumen-series-2`, `--lumen-series-3`, `--lumen-series-4`, `--lumen-series-5`, `--lumen-series-6`, `--lumen-warn`, `--lumen-warn-text`); this item's CSS also reads `--lumen-font-mono`, `--lumen-font-sans`, `--lumen-radius-k`. Never add Tailwind colour classes inside the component.

```tsx
import { PricingPlans, type PricingFeature, type PricingPlan } from "@/components/ui/lumen/blocks/pricing-plans";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `PricingPlans` | `pricing-plans` | The billing switch, plan cards and the comparison (table or per-plan lists). |

Style a part with `[data-slot="<slot>"]` selectors or its `className`; keep the attributes when editing.

## Sound
- Keep every `data-slot` and `data-sound` attribute: the sound layer reads them.
- Installing this item adds no audio. Nothing plays until the app mounts `GlassSoundProvider` once (install: `npx shadcn@latest add https://beautiful-ui.dev/r/glass-sound.json`, import from `@/components/beautiful-ui/glass-sound`); `GlassSoundToggle` is its mute control. Without a provider the audio engine never loads.

## Match the original
- Read `components/ui/lumen/blocks/pricing-plans.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- pricing page, pricing table, plan cards, plan comparison, monthly yearly pricing, upgrade page, choose a plan
- A pricing page or an in-app upgrade screen with two to four plans
- Comparing what each plan includes, row by row

### Not when
- One price: put Billing Toggle and a button on your own card
- The current plan's usage and invoices: use the Billing screen in SaaS Screens

## Mistakes
- monthly and yearly are both per month; yearly is the discounted monthly rate, and the note says the yearly total
- Keep plan ids the same as the keys in each feature's values
- Don't hide the comparison on phones; the per-plan lists are made for it

## Usage

```tsx
"use client";
import { PricingPlans, type PricingFeature, type PricingPlan } from "@/components/ui/lumen/blocks/pricing-plans";

const plans: PricingPlan[] = [
  { id: "starter", name: "Starter", tagline: "For trying it out", monthly: 0, yearly: 0, note: "Free forever", highlights: ["3 projects", "Community support"] },
  { id: "team", name: "Team", tagline: "For growing teams", monthly: 24, yearly: 19, featured: true, highlights: ["Unlimited projects", "SSO", "Priority support"] },
  { id: "enterprise", name: "Enterprise", tagline: "For large organisations", highlights: ["Audit log", "Custom contract"] },
];

const features: PricingFeature[] = [
  { id: "projects", label: "Projects", values: { starter: "3", team: "Unlimited", enterprise: "Unlimited" } },
  { id: "sso", label: "Single sign-on", values: { starter: false, team: true, enterprise: true } },
  { id: "audit", label: "Audit log", values: { starter: false, team: false, enterprise: true } },
];

export function Pricing() {
  return (
    <PricingPlans
      plans={plans}
      features={features}
      onSelect={async (plan, period) => {
        if (plan.id === "enterprise") return void (window.location.href = "/contact");
        const res = await fetch("/api/checkout", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ plan: plan.id, period }) });
        if (!res.ok) throw new Error("Checkout didn't open. Try again.");
        window.location.href = (await res.json()).url;
      }}
    />
  );
}
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `plans` | `PricingPlan[]` |  | PricingPlan = { id, name, tagline?, monthly?, yearly?, note?, highlights?, cta?, featured?, current? }. Leave out both prices for a Contact us plan; give one to show that price in both periods. |
| `features` | `PricingFeature[]` |  | Comparison rows: { id, label, group?, values: { [planId]: true \| false \| string } }. Omit for cards only. |
| `period / defaultPeriod / onPeriodChange` | `"monthly" \| "yearly"` | `"yearly"` | The billing period, controlled or not. |
| `onSelect` | `(plan, period) => unknown` |  | A plan's button was pressed. Return a promise to show progress on that button; throw to show the error under it. |
| `currency / locale` | `string / string` | `"USD" / "en-US"` | How prices are written. |
| `hideToggle` | `boolean` |  | No billing switch (one period only). |
| `labels` | `Partial<PricingPlansLabels>` |  | Every word, for i18n: the badge, Your plan, Contact us, choose(name), savings(percent) (worked out from your prices; return "" to hide), monthly / yearly, per, billedYearly(total), billedMonthly. |

Full docs: https://beautiful-ui.dev/components/lumen-pricing-plans

## Customising
- Colours: set the `--lumen-*` tokens on `:root`, or on a container with the `lumen-scope` class to retheme one area. Add the `lumen-inherit` class to follow your shadcn palette instead (`--chart-N`, `--destructive`).
- Dark mode follows the `.dark` class on an ancestor (the shadcn and next-themes convention).
- Update later by re-running the install with `--overwrite` (review the diff if you edited it). Changelog: https://beautiful-ui.dev/r/changelog.json

## Keyboard

| Keys | Action |
|---|---|
| Tab | The billing switch, then each plan's button, then the comparison |
| ← / → | Change the billing period (on the switch) |
| Enter / Space | Choose a plan, or open a plan's list on phones |

## Performance

- Static markup; the only animation is the price roll

## Responsive

- Plans sit side by side and stack under 760px of width; the comparison table becomes a list per plan under 640px

## Motion inventory

| Interaction | What moves |
|---|---|
| Billing period | Prices roll digit by digit to the new amount (Billing Toggle) |
| Choose | The button shows progress until onSelect settles |

## Accessibility contract (preserve when editing)
- Each plan is a list item headed by its name; prices are read as one phrase ("$19 / month") even while digits roll
- Checks and dashes in the comparison carry "Included" / "Not included" for screen readers; the table has row and column headers
- A plan's error is announced (role alert) and tied to its button
- On phones the comparison is a disclosure per plan (native details), so nothing scrolls sideways

## Install

```bash
npx shadcn@latest add @beautiful-ui-pro/lumen-pricing-plans
```

Pro item: needs the `@beautiful-ui-pro` registry in `components.json` and `BEAUTIFUL_UI_TOKEN` in `.env.local` (https://beautiful-ui.dev/account). Setup: https://beautiful-ui.dev/docs/pro. Your components.json `style` picks the build: radix-*, new-york and default get Radix, base-* gets Base UI.

The lumen foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://beautiful-ui.dev/r/lumen-foundation.json.
