Component packs › Ledger › Usage Calculator

Usage Calculator

Move the sliders and every line of the bill turns on its wheels, the total follows, and the bar re-divides into plan, requests and storage.

Usage Calculator is a pricing calculator 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: metered pricing, free allowances, cost bar.

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.

Usage Calculator props

PropTypeDefaultDescription
pricingUsagePricing
callsnumber
gbnumber
currencystring
labelstring
darkboolean
onChange(total: number, parts: { base: number; calls: number; storage: number }) => void
autoplaynumber | falseShowcase mode: tries a new usage every N ms while visible.

Methods on the ref

Use it in React

import UsageCalculator from './UsageCalculator';

<UsageCalculator />

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

More in Ledger

Good for: Pricing and payment.