# Plan Card

- Page: <https://kznlabs.github.io/labsUI/components/plan-card>

## Plan Card (`plan-card`, block)

One plan or rank at one price: earlier price, note, features and a call to action; PlanGrid lays out several. Server-safe. During a price reduction, `lowestPrice` shows the lowest price from the 30 days before it as visible text; the EU's Omnibus rule (Art. 6a of Directive 98/6) asks for this. A pointer, not legal advice: your app owns the price history and passes it only during a promotion, and no discount percentage is computed.

- Install: `npx @kznlabs/labsui add plan-card`
- Docs: <https://kznlabs.github.io/labsUI/components/plan-card>
- Brings: badge, card, utils
- npm: clsx@^2.1.1, lucide-react@1.63.0, tailwind-merge@^3.7.0

### API

- `<PlanCard>` (+ <div> props): One plan or rank at one price, no state, so it renders on the server. Several go in a PlanGrid.
  - `name: string`: Plan name, the card's heading.
  - `price: ReactNode`: Current price in major units, or your own node (Pricing passes its animated price).
  - `badge?: string`: Small label on the card, e.g. "Popular".
  - `compareAt?: number`: Struck-through earlier price. Hidden when a numeric `price` isn't lower.
  - `cta?: ReactNode`: Call to action, e.g. `<Button className="w-full">Buy</Button>`.
  - `currency?: string`: ISO 4217 code for the price.
  - `description?: ReactNode`: One line under the name.
  - `featured?: boolean`: Outlined in the accent.
  - `features?: string[]` = `[]`: What the plan includes, one check mark each.
  - `locale?: string`: BCP 47 locale for number formatting.
  - `lowestPrice?: number`: Lowest price from the 30 days before a reduction, shown as text under the price. Pass it only during a promotion.
  - `lowestPriceLabel?: ReactNode` = `"Lowest price in the 30 days before the reduction"`: Text before `lowestPrice`. Polish: "Najniższa cena z 30 dni przed obniżką".
  - `note?: ReactNode`: Beside the price, e.g. "/ month" or "forever".
  - `nowLabel?: string` = `"now"`: Read by screen readers between `compareAt` and the price.
- `<PlanGrid>` (+ <div> props): PlanCards side by side, as many columns as fit.

### Usage

```tsx
<PlanCard name="Gold" price={129} compareAt={149} lowestPrice={149} note="forever" features={["Cosmetic trail"]} cta={<Button className="w-full">Buy</Button>} />
```

### Example: rank-cards.tsx

```tsx
import { PlanCard, PlanGrid } from "@/components/blocks/plan-card";
import { buttonVariants } from "@/components/ui/button-variants";

export function RankCards() {
  return (
    <PlanGrid>
      <PlanCard
        name="Iron"
        price={9.99}
        note="for 30 days"
        features={["Iron name colour"]}
        cta={<a className={buttonVariants({ variant: "outline", className: "w-full" })} href="/buy/iron">Buy</a>}
      />
      <PlanCard
        name="Gold"
        price={129}
        compareAt={149}
        lowestPrice={149}
        note="forever"
        badge="Sale"
        featured
        features={["Gold name colour", "Cosmetic trail"]}
        cta={<a className={buttonVariants({ className: "w-full" })} href="/buy/gold">Buy</a>}
      />
    </PlanGrid>
  );
}
```
