Docs
Pricing Toggle

Pricing Toggle

Monthly/annual billing toggle with animated price swap using Framer Motion.

Starter

$9/mo

Pro

$29/mo

Enterprise

$99/mo

Installation

Usage

"use client"
 
import { useState } from "react"
import { PricingToggle, AnimatedPrice } from "@/components/pioneerui/pricing-toggle"
 
export default function Pricing() {
  const [isAnnual, setIsAnnual] = useState(false)
 
  return (
    <>
      <PricingToggle onChange={setIsAnnual} discount="Save 20%" />
      <AnimatedPrice monthly={29} annual={23} isAnnual={isAnnual} />
    </>
  )
}

Props — PricingToggle

PropTypeDefaultDescription
monthlyLabelstringMonthlyMonthly option label
annualLabelstringAnnualAnnual option label
discountstringSave 20%Discount badge text
defaultAnnualbooleanfalseDefault selected state
onChange(isAnnual: boolean) => voidundefinedChange callback

Props — AnimatedPrice

PropTypeDefaultDescription
monthlystring | numberMonthly price (required)
annualstring | numberAnnual price (required)
isAnnualbooleanCurrent billing period (required)
currencystring$Currency symbol