ui-kit0.0

Signature

Billing toggle

Monthly ↔ yearly with rolling prices.

Monthly or yearly

A two-option segmented control with a savings badge on the yearly option. Switch it and the price rolls digit by digit to its new value while the highlight glides across.

$30/ month

Billed monthly, cancel anytime

When to use

  • Pricing pages and upgrade dialogs where the same plans are sold monthly and yearly.
  • Any price that changes with a choice the user just made: seats, region, billing period.

Not for: more than two periods (use a SegmentedControl with your own items), or a setting that takes effect immediately on an account (use a switch with a confirmation).

Pricing table

One toggle drives every card. Each BillingPrice sets announce={false} so screen readers don’t hear three prices at once; the selected option is announced by the toggle itself.

Starter

For freelancers and side projects.

$12/ month

Team

For teams that ship every week.

$24/ month

Business

SSO, audit log and priority support.

$64/ month

Labels, currency and locale

Labels and the badge are any content. Prices are formatted with Intl.NumberFormat, so currency symbols, separators and decimals follow the locale. Whole amounts show no decimals; anything else shows two.

9,99 €/ Monat

API

BillingToggle

PropTypeDefaultDescription
value / defaultValue'monthly' | 'yearly'— / 'monthly'Controlled or initial billing cycle.
onValueChange(value: BillingCycle) => void—Called when the cycle changes.
savingsReactNode—Badge in the yearly option, e.g. “Save 20%”. Part of its accessible name.
monthlyLabel / yearlyLabelReactNode'Monthly' / 'Yearly'Option labels.
size'sm' | 'md' | 'lg''md'Height: 32 / 38 / 46px (taller on touch screens).
fullWidthbooleanfalseStretch to the container.
namestring—Submits the cycle with a form.
aria-labelstring'Billing period'Accessible name of the radio group.

BillingPrice

PropTypeDefaultDescription
amountnumber—The price. Changing it rolls the digits.
currencystring'USD'ISO 4217 code.
localestring'en-US'Fixed by default so server and client render the same.
formatIntl.NumberFormatOptions—Merged over the currency defaults.
periodReactNode—Muted text after the amount, e.g. “/ month”.
size'sm' | 'md' | 'lg''md'Amount size: 24 / 34 / 40px.
announcebooleantruePolite live region for the new price.

Need the rolling digits alone? BillingPrice is built on AnimatedNumber from the animated counter.

Keyboard

KeyAction
TabMoves focus to the selected option (one tab stop).
← → ↑ ↓Moves to the other option and selects it.
Home / EndSelects Monthly / Yearly.

Accessibility

  • A radiogroup named “Billing period” with two radios; the savings badge is read with the yearly option (“Yearly Save 20%”).
  • BillingPrice exposes one plain text node (“$24”) inside a polite, atomic live region; the rolling cells are hidden from assistive tech.
  • The badge uses the success tint with the success text colour, measured at 4.5:1 or more in light and dark.

Motion

  • The highlight pill glides on the morph spring; it does not animate on first render.
  • Each changed digit rolls on the morph spring; digits that appear (9 → 10) rise in.
  • Pressing the yearly option nudges the badge to .96 on the snappy spring.
  • Reduced motion: the selection and the price change instantly.