Pricing
Plans with a monthly and yearly switch.
Variants
4 more takes on the pricing, each a single file you install on its own by its id.
aui-021Comparison table
Plans compared feature by feature.
$ pnpm dlx asta-ui@latest add pricing-aui-021aui-022Painted plan
One plan on a painted card.
$ pnpm dlx asta-ui@latest add pricing-aui-022aui-023Usage calculator
Drag usage, watch the price.
$ pnpm dlx asta-ui@latest add pricing-aui-023aui-024Tier picker
Pick a tier from a list.
$ pnpm dlx asta-ui@latest add pricing-aui-024Installation
Run the CLI
Run
pnpm dlx asta-ui@latest initonce, then this. The file lands incomponents/astabyte/, installsradix-ui@base-ui/reactand the colour tokens go into your CSS. This is the Radix build. Drop --radix for Base UI.This is the Base UI build, the default. Want Radix? Add --radix.$ pnpm dlx asta-ui@latest add pricing --radixOr install the package
Don’t want the file? Import from
asta-uiasta-ui/baseand update withpnpm update asta-ui. Add the stylesheet once. More.$ pnpm add asta-ui radix-ui @base-ui/reactimport { Pricing } from "asta-ui";import { Pricing } from "asta-ui/base";Or copy it by hand
Install
radix-ui@base-ui/react, then copy these files. Keep the paths, or fix the@/imports. Then add the tokens fromglobals.css."use client"; import { useRef, useState } from "react"; import { Button } from "@/components/kit/button"; const cx = (...c: (string | false | null | undefined)[]) => c.filter(Boolean).join(" "); export type Billing = "monthly" | "yearly"; export interface Plan { name: string; description: string; /** Price per month for each billing period. */ price: Record<Billing, number>; features: string[]; cta: { label: string; href: string }; /** The recommended plan gets the dark card and a badge. */ highlight?: string; } export interface PricingProps { plans: Plan[]; currency?: string; /** Badge next to "Yearly", e.g. "−20%". */ saving?: string; defaultBilling?: Billing; className?: string; } const EASE = "ease-[cubic-bezier(.16,1,.3,1)]"; /** One digit as a vertical strip of 0–9 that slides to the new value. */ function Digit({ d, delay }: { d: number; delay: number }) { return ( <span className="relative inline-block h-[1em] w-[0.62em] overflow-hidden"> <span className={cx("absolute inset-x-0 top-0 flex flex-col transition-transform duration-700 motion-reduce:transition-none", EASE)} style={{ transform: `translateY(${-d * 10}%)`, transitionDelay: `${delay}ms` }} > {Array.from({ length: 10 }, (_, n) => ( <span key={n} className="block h-[1em] text-center leading-[1em]"> {n} </span> ))} </span> </span> ); } /** A number whose digits roll, right to left, when it changes. Screen readers get the plain value. */ export function RollingNumber({ value, className = "" }: { value: number; className?: string }) { const digits = String(Math.max(0, Math.round(value))).split("").map(Number); return ( <span className={cx("inline-flex tabular-nums", className)}> <span className="sr-only">{value}</span> <span aria-hidden className="inline-flex"> {digits.map((d, i) => ( <Digit key={digits.length - i} d={d} delay={(digits.length - 1 - i) * 60} /> ))} </span> </span> ); } /** * Two options with a pill that slides between them. The options share one grid with equal columns, so the * pill is half the width and moves by its own width: no measuring, no layout read when the page loads. */ export function BillingSwitch({ value, onChange, saving }: { value: Billing; onChange: (b: Billing) => void; saving?: string }) { const refs = useRef<Record<Billing, HTMLButtonElement | null>>({ monthly: null, yearly: null }); return ( <div role="radiogroup" aria-label="Billing period" className="relative grid grid-cols-2 rounded-[10px] bg-paper-2 p-1 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--color-ink)_8%,transparent)]"> <span aria-hidden className={cx("absolute bottom-1 left-1 top-1 w-[calc(50%-4px)] rounded-[7px] bg-paper shadow-[0_1px_2px_rgb(0_0_0/0.12),0_0_0_1px_color-mix(in_srgb,var(--color-ink)_8%,transparent)] transition-transform duration-500 motion-reduce:transition-none", EASE)} style={{ transform: value === "yearly" ? "translateX(100%)" : "none" }} /> {(["monthly", "yearly"] as const).map((b) => ( <button key={b} ref={(el) => { refs.current[b] = el; }} type="button" role="radio" aria-checked={value === b} tabIndex={value === b ? 0 : -1} onClick={() => onChange(b)} onKeyDown={(e) => { if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(e.key)) { e.preventDefault(); const next = b === "monthly" ? "yearly" : "monthly"; onChange(next); refs.current[next]?.focus(); } }} className={cx( "relative z-10 flex h-8 items-center justify-center gap-1.5 rounded-[7px] px-4 text-[13px] font-medium capitalize outline-none transition-colors duration-300 focus-visible:ring-2 focus-visible:ring-brand/50", value === b ? "text-ink" : "text-mute hover:text-ink", )} > {b} {b === "yearly" && saving && <span className="rounded-[4px] bg-brand px-1.5 text-[10.5px] leading-[18px] text-on-brand">{saving}</span>} </button> ))} </div> ); } const Check = () => ( <svg viewBox="0 0 24 24" className="mt-[3px] h-3.5 w-3.5 shrink-0" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden> <path d="m5 12.5 4.5 4.5L19 7.5" /> </svg> ); /** * Plans with a monthly / yearly switch. Prices roll digit by digit to the new amount; the highlighted * plan sits on an inverted card. Cards stack below 540px of container width (wrap it in `@container`). */ export function Pricing({ plans, currency = "$", saving, defaultBilling = "monthly", className }: PricingProps) { const [billing, setBilling] = useState<Billing>(defaultBilling); return ( <div className={cx("flex w-full flex-col items-center gap-6", className)}> <BillingSwitch value={billing} onChange={setBilling} saving={saving} /> <div className="grid w-full gap-3 @min-[540px]:grid-cols-3"> {plans.map((p) => { const hi = !!p.highlight; return ( <div key={p.name} className={cx( "relative flex flex-col rounded-xl p-4 @min-[700px]:p-5 transition-transform duration-500", EASE, hi ? "bg-ink text-paper shadow-[0_24px_50px_-24px_rgb(0_0_0/0.5)] @min-[540px]:-translate-y-2" : "bg-paper text-ink shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--color-ink)_12%,transparent)]", )} > <div className="flex items-center justify-between gap-2"> <h3 className="text-[15px] font-medium tracking-[-0.01em]">{p.name}</h3> {hi && <span className="rounded-[5px] bg-brand px-2 py-0.5 text-[11px] font-medium text-on-brand">{p.highlight}</span>} </div> <p className={cx("mt-1 text-[12.5px] leading-snug", hi ? "text-paper/60" : "text-mute")}>{p.description}</p> <div className="mt-5 flex items-end gap-1"> <span className="flex items-start font-medium leading-none tracking-[-0.04em]"> <span className="mr-0.5 mt-1 text-[20px]">{currency}</span> <RollingNumber value={p.price[billing]} className="text-[40px]" /> </span> <span className={cx("pb-1 text-[12px]", hi ? "text-paper/55" : "text-mute")}>/ month</span> </div> <p className={cx("mt-1.5 h-4 text-[11.5px] transition-opacity duration-300", hi ? "text-paper/55" : "text-mute", billing === "yearly" && p.price.yearly > 0 ? "opacity-100" : "opacity-0")}> Billed {currency} {p.price.yearly * 12} a year </p> <Button href={p.cta.href} variant={hi ? "accent" : "outline"} shape="pill" className={cx("mt-5 w-full", hi && "shadow-none")} > {p.cta.label} </Button> <ul className="mt-5 flex flex-col gap-2"> {p.features.map((f) => ( <li key={f} className={cx("flex gap-2 text-[13px] leading-snug", hi ? "text-paper/85" : "text-ink-2")}> <span className={hi ? "text-brand" : "text-ink"}> <Check /> </span> {f} </li> ))} </ul> </div> ); })} </div> </div> ); } export default Pricing;"use client"; import { useRef, useState } from "react"; import { Button } from "@/components/kit/base/button"; const cx = (...c: (string | false | null | undefined)[]) => c.filter(Boolean).join(" "); export type Billing = "monthly" | "yearly"; export interface Plan { name: string; description: string; /** Price per month for each billing period. */ price: Record<Billing, number>; features: string[]; cta: { label: string; href: string }; /** The recommended plan gets the dark card and a badge. */ highlight?: string; } export interface PricingProps { plans: Plan[]; currency?: string; /** Badge next to "Yearly", e.g. "−20%". */ saving?: string; defaultBilling?: Billing; className?: string; } const EASE = "ease-[cubic-bezier(.16,1,.3,1)]"; /** One digit as a vertical strip of 0–9 that slides to the new value. */ function Digit({ d, delay }: { d: number; delay: number }) { return ( <span className="relative inline-block h-[1em] w-[0.62em] overflow-hidden"> <span className={cx("absolute inset-x-0 top-0 flex flex-col transition-transform duration-700 motion-reduce:transition-none", EASE)} style={{ transform: `translateY(${-d * 10}%)`, transitionDelay: `${delay}ms` }} > {Array.from({ length: 10 }, (_, n) => ( <span key={n} className="block h-[1em] text-center leading-[1em]"> {n} </span> ))} </span> </span> ); } /** A number whose digits roll, right to left, when it changes. Screen readers get the plain value. */ export function RollingNumber({ value, className = "" }: { value: number; className?: string }) { const digits = String(Math.max(0, Math.round(value))).split("").map(Number); return ( <span className={cx("inline-flex tabular-nums", className)}> <span className="sr-only">{value}</span> <span aria-hidden className="inline-flex"> {digits.map((d, i) => ( <Digit key={digits.length - i} d={d} delay={(digits.length - 1 - i) * 60} /> ))} </span> </span> ); } /** * Two options with a pill that slides between them. The options share one grid with equal columns, so the * pill is half the width and moves by its own width: no measuring, no layout read when the page loads. */ export function BillingSwitch({ value, onChange, saving }: { value: Billing; onChange: (b: Billing) => void; saving?: string }) { const refs = useRef<Record<Billing, HTMLButtonElement | null>>({ monthly: null, yearly: null }); return ( <div role="radiogroup" aria-label="Billing period" className="relative grid grid-cols-2 rounded-[10px] bg-paper-2 p-1 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--color-ink)_8%,transparent)]"> <span aria-hidden className={cx("absolute bottom-1 left-1 top-1 w-[calc(50%-4px)] rounded-[7px] bg-paper shadow-[0_1px_2px_rgb(0_0_0/0.12),0_0_0_1px_color-mix(in_srgb,var(--color-ink)_8%,transparent)] transition-transform duration-500 motion-reduce:transition-none", EASE)} style={{ transform: value === "yearly" ? "translateX(100%)" : "none" }} /> {(["monthly", "yearly"] as const).map((b) => ( <button key={b} ref={(el) => { refs.current[b] = el; }} type="button" role="radio" aria-checked={value === b} tabIndex={value === b ? 0 : -1} onClick={() => onChange(b)} onKeyDown={(e) => { if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].includes(e.key)) { e.preventDefault(); const next = b === "monthly" ? "yearly" : "monthly"; onChange(next); refs.current[next]?.focus(); } }} className={cx( "relative z-10 flex h-8 items-center justify-center gap-1.5 rounded-[7px] px-4 text-[13px] font-medium capitalize outline-none transition-colors duration-300 focus-visible:ring-2 focus-visible:ring-brand/50", value === b ? "text-ink" : "text-mute hover:text-ink", )} > {b} {b === "yearly" && saving && <span className="rounded-[4px] bg-brand px-1.5 text-[10.5px] leading-[18px] text-on-brand">{saving}</span>} </button> ))} </div> ); } const Check = () => ( <svg viewBox="0 0 24 24" className="mt-[3px] h-3.5 w-3.5 shrink-0" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden> <path d="m5 12.5 4.5 4.5L19 7.5" /> </svg> ); /** * Plans with a monthly / yearly switch. Prices roll digit by digit to the new amount; the highlighted * plan sits on an inverted card. Cards stack below 540px of container width (wrap it in `@container`). */ export function Pricing({ plans, currency = "$", saving, defaultBilling = "monthly", className }: PricingProps) { const [billing, setBilling] = useState<Billing>(defaultBilling); return ( <div className={cx("flex w-full flex-col items-center gap-6", className)}> <BillingSwitch value={billing} onChange={setBilling} saving={saving} /> <div className="grid w-full gap-3 @min-[540px]:grid-cols-3"> {plans.map((p) => { const hi = !!p.highlight; return ( <div key={p.name} className={cx( "relative flex flex-col rounded-xl p-4 @min-[700px]:p-5 transition-transform duration-500", EASE, hi ? "bg-ink text-paper shadow-[0_24px_50px_-24px_rgb(0_0_0/0.5)] @min-[540px]:-translate-y-2" : "bg-paper text-ink shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--color-ink)_12%,transparent)]", )} > <div className="flex items-center justify-between gap-2"> <h3 className="text-[15px] font-medium tracking-[-0.01em]">{p.name}</h3> {hi && <span className="rounded-[5px] bg-brand px-2 py-0.5 text-[11px] font-medium text-on-brand">{p.highlight}</span>} </div> <p className={cx("mt-1 text-[12.5px] leading-snug", hi ? "text-paper/60" : "text-mute")}>{p.description}</p> <div className="mt-5 flex items-end gap-1"> <span className="flex items-start font-medium leading-none tracking-[-0.04em]"> <span className="mr-0.5 mt-1 text-[20px]">{currency}</span> <RollingNumber value={p.price[billing]} className="text-[40px]" /> </span> <span className={cx("pb-1 text-[12px]", hi ? "text-paper/55" : "text-mute")}>/ month</span> </div> <p className={cx("mt-1.5 h-4 text-[11.5px] transition-opacity duration-300", hi ? "text-paper/55" : "text-mute", billing === "yearly" && p.price.yearly > 0 ? "opacity-100" : "opacity-0")}> Billed {currency} {p.price.yearly * 12} a year </p> <Button href={p.cta.href} variant={hi ? "accent" : "outline"} shape="pill" className={cx("mt-5 w-full", hi && "shadow-none")} > {p.cta.label} </Button> <ul className="mt-5 flex flex-col gap-2"> {p.features.map((f) => ( <li key={f} className={cx("flex gap-2 text-[13px] leading-snug", hi ? "text-paper/85" : "text-ink-2")}> <span className={hi ? "text-brand" : "text-ink"}> <Check /> </span> {f} </li> ))} </ul> </div> ); })} </div> </div> ); } export default Pricing;Or ask your AI agent
Paste this into Claude Code, Cursor, Codex, v0 or Lovable. Fill in the last line. More in Prompts.
Add the Astabyte UI Pricing component to my project. Plans with a monthly and yearly switch. It includes: billing switch, plans, features. Install it (Radix build): ```sh pnpm dlx asta-ui@latest add pricing --radix ``` Or with the shadcn CLI: ```sh pnpm dlx shadcn@latest add https://ui.astabyte.com/r/pricing.json ``` If the project isn't set up yet, run `pnpm dlx asta-ui@latest init --radix` first: it runs `shadcn init` when needed and adds the @astabyte registry (Next.js, Vite, React Router, Astro, TanStack Start; Tailwind CSS v4). Import it like this: ```tsx import { Pricing, type Plan } from "@/components/astabyte/pricing"; ``` Usage example and props: https://ui.astabyte.com/pricing Full catalogue for context: https://ui.astabyte.com/llms.txt Rules: - Keep the colour tokens (paper, paper-2, ink, ink-2, mute, brand). Don't restyle with hard-coded colours; rebrand by changing the token values in the CSS. - Keep the motion as it is: transform and opacity only, and the prefers-reduced-motion fallback. - Keep keyboard, focus and ARIA behaviour (interactive pieces are built on Radix primitives from the radix-ui package). - Stay on Radix: install other Astabyte UI components with `--radix` so the project uses one primitive library. - Use fake data and fake brand names in examples. Use it to: [describe where it goes and what it should do]Add the Astabyte UI Pricing component to my project. Plans with a monthly and yearly switch. It includes: billing switch, plans, features. Install it (Base UI build): ```sh pnpm dlx asta-ui@latest add pricing ``` Or with the shadcn CLI: ```sh pnpm dlx shadcn@latest add https://ui.astabyte.com/r/base/pricing.json ``` If the project isn't set up yet, run `pnpm dlx asta-ui@latest init` first: it runs `shadcn init` when needed and adds the @astabyte registry (Next.js, Vite, React Router, Astro, TanStack Start; Tailwind CSS v4). Import it like this: ```tsx import { Pricing, type Plan } from "@/components/astabyte/pricing"; ``` Usage example and props: https://ui.astabyte.com/pricing Full catalogue for context: https://ui.astabyte.com/llms.txt Rules: - Keep the colour tokens (paper, paper-2, ink, ink-2, mute, brand). Don't restyle with hard-coded colours; rebrand by changing the token values in the CSS. - Keep the motion as it is: transform and opacity only, and the prefers-reduced-motion fallback. - Keep keyboard, focus and ARIA behaviour (interactive pieces are built on Base UI primitives from the @base-ui/react package). - Stay on Base UI: install other Astabyte UI components without `--radix` so the project uses one primitive library. - Use fake data and fake brand names in examples. Use it to: [describe where it goes and what it should do]Or use plain HTML + CSS
Not on React? Use it from Django, Rails, Laravel, Go
html/template, htmx or a static page. Loadasta.cssandasta.jsonce (thehead.htmltab), then paste the markup. Theui.astabyte.com/cdnlink is temporary: pin a version from jsDelivr for production. More in HTML + CSS.<!-- Needs asta.js for the rolling price digits (the monthly/yearly switch itself is CSS). --> <div style="max-width:960px"> <div id="pricing" data-asta-pricing class="asta-plans"> <div role="radiogroup" aria-label="Billing period" class="asta-plans-period"><span aria-hidden="true" data-asta-pricing-pill class="asta-plans-pill"></span> <label class="asta-plans-option"><input type="radio" name="billing" value="monthly" checked class="asta-sr-only">Monthly</label> <label class="asta-plans-option"><input type="radio" name="billing" value="yearly" class="asta-sr-only">Yearly<span class="asta-plans-saving">−20%</span></label></div> <div class="asta-plans-grid"> <div class="asta-plans-card"><div class="asta-plans-card-head"><h3 class="asta-plans-name">Starter</h3></div><p class="asta-plans-desc">For side projects and trying things out.</p> <div class="asta-plans-price"><span class="asta-plans-amount"><span class="asta-plans-currency">$</span><span class="asta-plans-number"><span class="asta-sr-only" data-asta-pricing-for="monthly">0</span><span class="asta-sr-only" data-asta-pricing-for="yearly">0</span><span aria-hidden="true" class="asta-plans-digits"><span class="asta-pricing-digit asta-plans-digit" style="--m:0;--y:0;--dl:0ms"><span class="asta-pricing-strip asta-plans-strip"><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span></span></span></span></span></span></span><span class="asta-plans-per">/ month</span></div> <p data-asta-pricing-yearly-note class="asta-plans-note asta-plans-note-none">Billed $0 a year</p> <a class="asta-btn asta-btn-outline asta-btn-pill asta-plans-cta" href="#pricing"><span class="asta-btn-label">Start free</span><span class="asta-btn-spinner" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" aria-hidden="true"><circle cx="8" cy="8" r="6" stroke="currentColor" stroke-opacity="0.25" stroke-width="2"/><path d="M14 8a6 6 0 0 0-6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></span></a> <ul class="asta-plans-features"><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>1 project</li><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>Community support</li><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>7-day history</li></ul></div> <div class="asta-plans-card asta-plans-card-featured"><div class="asta-plans-card-head"><h3 class="asta-plans-name">Team</h3><span class="asta-plans-flag">Popular</span></div><p class="asta-plans-desc">For small teams shipping every week.</p> <div class="asta-plans-price"><span class="asta-plans-amount"><span class="asta-plans-currency">$</span><span class="asta-plans-number"><span class="asta-sr-only" data-asta-pricing-for="monthly">24</span><span class="asta-sr-only" data-asta-pricing-for="yearly">19</span><span aria-hidden="true" class="asta-plans-digits"><span class="asta-pricing-digit asta-plans-digit" style="--m:2;--y:1;--dl:60ms"><span class="asta-pricing-strip asta-plans-strip"><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span></span></span></span><span class="asta-pricing-digit asta-plans-digit" style="--m:4;--y:9;--dl:0ms"><span class="asta-pricing-strip asta-plans-strip"><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span></span></span></span></span></span></span><span class="asta-plans-per">/ month</span></div> <p data-asta-pricing-yearly-note class="asta-plans-note">Billed $228 a year</p> <a class="asta-btn asta-btn-accent asta-btn-pill asta-plans-cta" href="#pricing"><span class="asta-btn-label">Start trial</span><span class="asta-btn-spinner" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" aria-hidden="true"><circle cx="8" cy="8" r="6" stroke="currentColor" stroke-opacity="0.25" stroke-width="2"/><path d="M14 8a6 6 0 0 0-6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></span></a> <ul class="asta-plans-features"><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>Unlimited projects</li><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>Preview links</li><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>90-day history</li><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>Email support</li></ul></div> <div class="asta-plans-card"><div class="asta-plans-card-head"><h3 class="asta-plans-name">Business</h3></div><p class="asta-plans-desc">For larger teams with stricter needs.</p> <div class="asta-plans-price"><span class="asta-plans-amount"><span class="asta-plans-currency">$</span><span class="asta-plans-number"><span class="asta-sr-only" data-asta-pricing-for="monthly">89</span><span class="asta-sr-only" data-asta-pricing-for="yearly">71</span><span aria-hidden="true" class="asta-plans-digits"><span class="asta-pricing-digit asta-plans-digit" style="--m:8;--y:7;--dl:60ms"><span class="asta-pricing-strip asta-plans-strip"><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span></span></span></span><span class="asta-pricing-digit asta-plans-digit" style="--m:9;--y:1;--dl:0ms"><span class="asta-pricing-strip asta-plans-strip"><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span></span></span></span></span></span></span><span class="asta-plans-per">/ month</span></div> <p data-asta-pricing-yearly-note class="asta-plans-note">Billed $852 a year</p> <a class="asta-btn asta-btn-outline asta-btn-pill asta-plans-cta" href="#pricing"><span class="asta-btn-label">Talk to us</span><span class="asta-btn-spinner" aria-hidden="true"><svg viewBox="0 0 16 16" fill="none" aria-hidden="true"><circle cx="8" cy="8" r="6" stroke="currentColor" stroke-opacity="0.25" stroke-width="2"/><path d="M14 8a6 6 0 0 0-6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></span></a> <ul class="asta-plans-features"><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>Everything in Team</li><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>SSO and audit log</li><li class="asta-plans-feature"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3.5 8.5 3 3 6-7"/></svg>Priority support</li></ul></div> </div></div> </div>
Usage
The demo above, as code.
"use client";
import { Pricing, type Plan } from "@/components/astabyte/pricing";
const PLANS: Plan[] = [
{
name: "Starter",
description: "For side projects and trying things out.",
price: { monthly: 0, yearly: 0 },
features: ["1 project", "1,000 events a month", "Community support"],
cta: { label: "Start free", href: "#" },
},
{
name: "Pro",
description: "For small teams shipping every week.",
price: { monthly: 24, yearly: 19 },
features: ["Unlimited projects", "100k events a month", "Automations", "Email support"],
cta: { label: "Start 14-day trial", href: "#" },
highlight: "Popular",
},
{
name: "Business",
description: "For companies that need control.",
price: { monthly: 89, yearly: 71 },
features: ["Everything in Pro", "SSO and audit logs", "99.9% uptime SLA", "A real human on call"],
cta: { label: "Talk to sales", href: "#" },
},
];
export default function PricingDemo() {
return (
<div className="flex min-h-[420px] w-full items-center justify-center p-3 sm:p-6">
<div className="@container w-full max-w-[880px]">
<Pricing plans={PLANS} saving="−20%" />
</div>
</div>
);
}