# Pricing, billing toggle

- **[Sections](/blocks/)**
- **[Pricing](/blocks/pricing/)**
- **Pricing, billing toggle**

Up to three plans with a monthly and yearly switch that changes every price. Both prices show while editing.

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/pricing-toggle
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/pricing-toggle';
  ```

Also called

- pricing/toggle

- **Category**: Plans and prices: tiers, a single plan, a toggle or a comparison table. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: Up to three plans with a monthly and yearly switch that changes every price at once. Use `pricing-tiers` when you offer one billing period only.
- **Writing for it**: - Each tier carries a monthly and a yearly price of 16 characters each. Write the yearly figure as the monthly equivalent if the period says 'per month'.
- The saving badge (32 characters) is drawn on the yearly button, such as 'Save 20%'. Empty it and the badge disappears.
- The monthly label is required, and yearly and monthly labels are also the accessible name of the switch. Use plain words like 'Monthly' and 'Yearly'.
- **Watch out for**: The page always loads on monthly, and only a visitor can switch it. In the canvas both prices are shown and the toggle is a static label, so a screenshot of the published page may show different numbers than your editor.

## Pairs well with

- **[Pricing, comparison table](/blocks/pricing/comparison)**
- **[FAQ, list](/blocks/faq/accordion)**
- **[Call to action, minimal](/blocks/cta/minimal)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import PricingToggle from '@/components/klarhimmel/blocks/pricing-toggle';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <PricingToggle props={{
          "eyebrow": "Section name",
          "title": "Say how billing can be chosen",
          "description": "Say in one sentence what every plan includes and what the choice is about.",
          "monthlyLabel": "Monthly",
          "yearlyLabel": "Yearly",
          "saving": "Save 00 %",
          "tiers": [
            {
              "name": "First plan",
              "monthly": "$00",
              "yearly": "$00",
              "period": "billing period",
              "description": "Say who this plan suits in one line",
              "features": [
                "Name a first feature",
                "Name a feature"
              ],
              "cta": {
                "label": "Main action",
                "href": "#start"
              },
              "featured": false
            },
            {
              "name": "Second plan",
              "monthly": "$00",
              "yearly": "$00",
              "period": "per unit, per period",
              "description": "Say who this plan suits in one line",
              "features": [
                "Name a first feature",
                "Name a second feature"
              ],
              "cta": {
                "label": "Main action",
                "href": "#trial"
              },
              "featured": true
            }
          ]
        }} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **eyebrow**: Text, up to 60 characters.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters.
- **monthlyLabel**: Text, up to 24 characters.
- **yearlyLabel**: Text, up to 24 characters.
- **saving**: Text, up to 32 characters.
- **tiers**: List of 1 to 3. Each item: name, monthly, yearly, period, description, features, cta, featured.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/pricing/tiers)

[Next](/blocks/pricing/usage)
