Skip to content

    Browse components

    Price Toggle

    A monthly / yearly pricing switch: the thumb slides between periods, the saving badge pops, and each digit of the price rolls to its new value, up when it rises and down when it drops.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/price-toggle

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/price-toggle.json

    Usage

    import { PriceToggle } from "@/components/ui/price-toggle";
    
    <PriceToggle monthly={24} yearly={19} value={billing} onChange={setBilling} />

    Props

    PropTypeDefaultDescription
    monthlynumber24Price per month, billed monthly.
    yearlynumber19Price per month, billed yearly.
    currencystring"$"Currency symbol.
    badgeReactNode—Yearly badge text; defaults to the computed saving.
    valueReactNode—Controlled "monthly" | "yearly", pair with onChange.
    classNamestring—Extra classes for the root element.