Pricing, billing toggle


Install
npx shadcn add @klarhimmel/pricing-toggleDetailsAbout, usage, props and more
Up to three plans with a monthly and yearly switch that changes every price. Both prices show while editing.
Import
Import
- 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
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Section name' | Text, up to 60 characters. |
title | string | 'Say how billing can be chosen' | Text, up to 120 characters. |
description | string | 'Say in one sentence what every plan…' | Text, up to 300 characters. |
monthlyLabel | string | 'Monthly' | Text, up to 24 characters. |
yearlyLabel | string | 'Yearly' | Text, up to 24 characters. |
saving | string | 'Save 00 %' | Text, up to 32 characters. |
tiers | { name, monthly, yearly, period, description, features, cta, featured }[] | 3 items | List of 1 to 3. Each item: name, monthly, yearly, period, description, features, cta, featured. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |