# Pricing

> Plan comparison with features, call-to-action buttons and an optional monthly / yearly switch.

Status: beta. Category: Blocks.

```ts
import { Pricing } from '@glyphui/blocks'
```

Exports: `Pricing`.

## Notes

- Numeric prices go through formatPrice; strings such as “Custom” are shown as they are.
- A tier with cta.href renders a link through your router’s link component.

## Pricing props

| Prop | Type | Default | Description |
|---|---|---|---|
| `tiers` (required) | `readonly PricingTier[]` |  |  |
| `animate` | `boolean` | `true` | Entrance animations as the block scrolls into view. They follow the theme's motion level and the visitor's reduced-motion setting; `false` turns them off for this block. Default true. |
| `billingLabels` | `Record<Billing, ReactNode>` | `{ monthly: 'Monthly', yearly: 'Yearly' }` | Labels for the billing switch. |
| `defaultBilling` | `Billing` | `monthly` |  |
| `description` | `ReactNode` |  |  |
| `eyebrow` | `ReactNode` |  |  |
| `formatPrice` | `((amount: number) => string)` |  | Turns numeric prices into text. Default: US dollars, with cents only when there are some. |
| `headingLevel` | `HeadingLevel` | `2` |  |
| `periodLabels` | `Record<Billing, ReactNode>` | `{   monthly: 'per month',   yearly: 'per month, billed yearly', }` | Shown after each numeric price above zero, per billing period. |
| `title` | `ReactNode` |  |  |

## Example: Three tiers

The billing switch appears when any tier has per-period prices.

```tsx
import { Pricing } from '@glyphui/blocks'

export default function Example() {
  return (
    <Pricing
      eyebrow="Pricing"
      title="Simple plans that grow with you"
      description="Start free. Upgrade when you send more than 50 invoices a month."
      defaultBilling="yearly"
      billingLabels={{ monthly: 'Monthly', yearly: 'Yearly · save 20%' }}
      tiers={[
        {
          name: 'Starter',
          description: 'For freelancers and side projects.',
          price: 0,
          features: ['50 invoices a month', 'Card and bank payments', 'Email support'],
          cta: { label: 'Start free', href: '#signup' },
        },
        {
          name: 'Growth',
          description: 'For teams billing on usage.',
          price: { monthly: 49, yearly: 39 },
          features: [
            'Unlimited invoices',
            'Usage-based pricing',
            'Dunning and retries',
            'Revenue reports',
          ],
          cta: { label: 'Start 14-day trial', href: '#trial' },
          highlighted: true,
          badge: 'Most popular',
        },
        {
          name: 'Enterprise',
          description: 'For finance teams with custom needs.',
          price: 'Custom',
          features: ['SSO and SCIM', 'Custom contracts', 'Dedicated support engineer'],
          cta: { label: 'Talk to sales', href: '#sales' },
        },
      ]}
    />
  )
}
```

## Example: Two tiers, custom format

```tsx
import { Pricing } from '@glyphui/blocks'

const euros = new Intl.NumberFormat('de-DE', {
  style: 'currency',
  currency: 'EUR',
  maximumFractionDigits: 0,
})

export default function Example() {
  return (
    <Pricing
      formatPrice={(amount) => euros.format(amount)}
      periodLabels={{ monthly: 'pro Monat', yearly: 'pro Monat, jährlich' }}
      billingLabels={{ monthly: 'Monatlich', yearly: 'Jährlich' }}
      tiers={[
        {
          name: 'Team',
          price: { monthly: 12, yearly: 10 },
          features: ['Bis zu 10 Personen', 'Unbegrenzte Projekte'],
          cta: { label: 'Testen', onClick: () => {} },
        },
        {
          name: 'Business',
          price: { monthly: 24, yearly: 20 },
          features: ['Unbegrenzte Personen', 'SSO', 'Prioritäts-Support'],
          cta: { label: 'Testen', onClick: () => {} },
          highlighted: true,
        },
      ]}
    />
  )
}
```

Live page: https://glyphui.xyz/components/pricing
