# PricingTable

Pricing tier cards with monthly/annual toggle, highlight badge and feature lists

> Component ID: `pricing-table`
> Import: `import { PricingTable } from '@slipstream-ui/core'`
> Docs: https://slipstreamui.com/docs/components/pricing-table
> Registry: https://slipstreamui.com/registry/pricing-table.json
> Tier: organism · Package: @slipstream-ui/core@0.16.0
> Manifest schema: v1 · manifest: v1

## Design intent

PricingTable renders conversion-focused tier cards: display-string prices (the consumer owns currency formatting), an automatic monthly/annual SegmentedControl toggle when tiers carry both prices, a highlighted tier with primary ring and badge, and CTA buttons that route through linkComponent. Cards stack to one column at 320px.

## Props

| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| tiers | `PricingTier[]` | — | yes | Tier definitions: name, description, monthlyPrice, annualPrice, priceSuffix, features, highlight, ctaHref, ctaLabel |
| billing | `'auto' | 'monthly' | 'annual'` | `'auto'` | no | Billing period: auto shows the toggle when any tier has both prices; monthly/annual force a period and hide it |
| billingLabel | `string` | `'Billing period'` | no | Accessible name for the billing toggle |
| linkComponent | `ElementType` | — | no | Router link element for tier CTAs (Next Link, react-router Link) |
| linkHrefProp | `'href' | 'to'` | `'href'` | no | Prop carrying the destination on linkComponent |
| className | `string` | — | no | Additional CSS classes to apply |

## Examples

### Three tiers with toggle

Toggle appears automatically; Pro gets the ring and badge

```tsx
<PricingTable
  billing="auto"
  tiers={[
    {
      name: 'Starter',
      monthlyPrice: '$0',
      annualPrice: '$0',
      features: ['3 projects', 'Community support'],
      ctaHref: '/signup',
      ctaLabel: 'Start free',
    },
    {
      name: 'Pro',
      monthlyPrice: '$29',
      annualPrice: '$23',
      priceSuffix: '/seat/mo',
      features: ['Unlimited projects', 'SSO'],
      highlight: true,
      ctaHref: '/pricing/pro',
      ctaLabel: 'Go Pro',
    },
  ]}
/>
```

## Anti-patterns

- **Don't format currency inside the component** — Prices are display strings — the consumer owns locale, currency and i18n. Pass pre-formatted values like '$29' or '29 €'.
- **Don't highlight every tier** — The highlight ring and badge are a visual emphasis for ONE recommended tier. Multiple highlights cancel each other out.

## Accessibility

- **Toggle semantics**: The billing control reuses SegmentedControl's radiogroup — arrow keys move between Monthly and Annual
- **Readable at 320px**: Cards stack to a single column below md; prices use large tracking-tight type that wraps cleanly
- **Feature inclusion**: Excluded features render muted with a dash marker distinct from the check marker

## Composition

- Compose with **SegmentedControl** — The billing toggle is a SegmentedControl in controlled mode
  
  ```tsx
  options=[{value:'monthly',label:'Monthly'},{value:'annual',label:'Annual'}]
  ```
- Compose with **Badge** — The highlight badge renders through Badge with the default variant
  
  ```tsx
  highlightLabel defaults to 'Most popular'
  ```
- Compose with **Button** — Tier CTAs render through Button asChild so they are real links
  
  ```tsx
  ctaHref + ctaLabel produce <Button asChild><a href>…</a></Button>
  ```
- Related: ComparisonTable, Badge, Button, SegmentedControl

