Billing toggle
A monthly/yearly switch whose price animates as it changes.
/ month
When to use
- Pricing pages and upgrade dialogs with two billing periods.
- You want the new price to feel connected to the choice.
When not to use
- More than three periods; use radio cards.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/billing-toggle
Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
BillingToggle
7 props
PropTypeDefault
labelstring"Billing period"
options *readonly BillingOption[]—
value *string—
onValueChange *(value: string) => void—
pricestring—
priceDirection"none" | "up" | "down""none"
classNamestring—
Keyboard
- →
- Moves to the next item or value.
- ↓
- Moves to the next item or value.
- ←
- Moves to the previous item or value.
- ↑
- Moves to the previous item or value.
Accessibility
It exposes radio and radiogroup semantics, with aria-checked, aria-label and aria-hidden kept in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/billing-toggle.mdThe index of every part is at /llms.txt.