# Ledger pricing

> A free Swiss architectural pricing section with three flush ruled columns, solid-ink inversion on the featured tier and a mechanical Monthly/Annual switch.

Generic rounded pricing cards with glowing borders make every SaaS page look identical. Ledger pricing delivers a free, MIT-licensed architectural pricing ledger: three flush columns inside one crisp border frame, full solid-ink surface inversion with an emerald top rule on the featured tier, a mechanical Monthly/Annual rocker switch and inline async checkout states.

## Install

```bash
npx shadcn@latest add @hairline/ledger-pricing
```

Needs React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

- npm: `lucide-react`
- Hairline UI components it needs (the CLI installs them too): none
- Docs and live preview: https://hairlineui.com/blocks/ledger-pricing
- Registry item (source): https://hairlineui.com/r/ledger-pricing.json

## Usage

```tsx
import { LedgerPricing } from "@/components/ledger-pricing";

<LedgerPricing
  tone="day"
  onSelectTier={async ({ tierId, billing }) => {
    console.log("Selected:", tierId, billing);
  }}
/>
```

## Daylight Swiss pricing ledger with Bricolage Grotesque

Pass a display face through --lp-display and supply your own tiers array.

```tsx
import { Bricolage_Grotesque } from "next/font/google";
import { LedgerPricing } from "@/components/ledger-pricing";

const display = Bricolage_Grotesque({ subsets: ["latin"] });

export function PricingBand() {
  return (
    <LedgerPricing
      tone="day"
      style={{ "--lp-display": display.style.fontFamily } as React.CSSProperties}
      onSelectTier={async ({ tierId, billing }) => {
        window.location.assign(`/checkout?plan=${tierId}&billing=${billing}`);
      }}
    />
  );
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tone` | `'day' \| 'night'` | `'day'` | Daylight gallery stone or dark charcoal palette. |
| `eyebrow / heading / subheading` | `string` | – | Section header copy. |
| `annualBadge` | `string` | `"Save 20%"` | Savings label inside the annual billing switch. |
| `tiers` | `LedgerTier[]` | – | Three pricing columns with monthlyPrice, annualPrice, featured flag and features list. |
| `onSelectTier` | `(payload: { tierId: string; billing: LedgerBilling; price: number \| null }) => Promise<unknown> \| void` | – | Async checkout callback fired on CTA click. |

## States

- **billing toggle**: Switching Monthly and Annual updates every tier price in place.
- **tier select**: Clicking a CTA invokes onSelectTier and updates the button label with a check mark.

## What it handles

A clean three-tier pricing section shouldn’t require heavy dependencies or look like a stock template.

- **Flush Swiss architectural ledger**: Three ruled columns share crisp structural borders with zero floating drop shadows.
- **Solid-ink featured tier inversion**: Highlights the primary tier through high-contrast ink inversion and an emerald top bar.
- **Mechanical Monthly / Annual switch**: Updates monthly and annual rates immediately across all numeric tiers.
- **Inline async tier checkout**: Passes tierId, billing and active price to your onSelectTier callback with Opening… and Selected states.

## Replaces

3-tier SaaS pricing cards, monthly/annual pricing toggle

## Where it fits

- **SaaS & developer tool pricing pages**: Clean three-tier layout with monthly/annual pricing and zero rounded-card bloat.
- **Studio & productized service tiers**: High-contrast Swiss ledger framing that reads clearly on phones and wide monitors.
- **Next.js & shadcn/ui landing pages**: Installs free under MIT with self-contained --lp-* daylight and night palettes.

## Notes

- Free and MIT-licensed; self-contained with zero animation libraries or registry dependencies.
- All colours ship as --lp-* CSS variables on the root.

License: MIT (https://hairlineui.com/license#components)
