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.
Installation
npx shadcn@latest add @glint-ui/price-toggleFirst 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
| Prop | Type | Default | Description |
|---|---|---|---|
| monthly | number | 24 | Price per month, billed monthly. |
| yearly | number | 19 | Price per month, billed yearly. |
| currency | string | "$" | Currency symbol. |
| badge | ReactNode | — | Yearly badge text; defaults to the computed saving. |
| value | ReactNode | — | Controlled "monthly" | "yearly", pair with onChange. |
| className | string | — | Extra classes for the root element. |