Component packs › Ledger › Billing Toggle

Billing Toggle

Switch to yearly and the price turns down on its digit wheels while the year's saving drops onto the card as a stack of coins, one at a time.

Billing Toggle is a pricing toggle from Ledger, a component pack with 6 pricing components: Pricing controls where every number turns on its own digit wheel and savings are a stack of coins. Price: $2 for the whole pack.

Built with: digit wheels, coin stack, computed saving.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Billing Toggle props

PropTypeDefaultDescription
monthlynumber24Price per month when paid monthly, in whole units. Default 24.
yearlynumber240 (two months free)Price for a year when paid yearly. Default 240 (two months free).
currencystring
planstring
value'monthly' | 'yearly'
coinnumber8Coin value for the savings stack. Default 8.
darkboolean
onChange(period: 'monthly' | 'yearly') => void
autoplaynumber | falseShowcase mode: switches every N ms while visible.

Methods on the ref

Use it in React

import BillingToggle from './BillingToggle';

<BillingToggle />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Ledger

Good for: Pricing and payment.