Pricing Toggle

A Monthly and Yearly billing period switch built on a segmented control, with a Save 20% with yearly note underneath. Pairs with pricing tables and plan cards.

src/registry/ui/pricing-toggle.tsx/r/pricing-toggle.json

Installation#

bash
npx shadcn@latest add @minidev/pricing-toggle

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/pricing-toggle.json

Usage#

tsx
import { PricingToggle } from "@/components/ui/pricing-toggle"

export function Example() {
  return (
    <PricingToggle value={cadence} onChange={setCadence} />
  )
}

API reference#

PricingToggle props
PropTypeDefault
value"monthly" | "yearly""monthly"
onChange(v: "monthly" | "yearly") => void-
classNamestring-

Dependencies#

npm

React only

Examples#

All pricing and billing components

Learn more