Pricing
pricingA pricing section with three tiers, a monthly and annual toggle the caller controls, and a featured tier marked by a stronger border and a small label rather than a coloured card. Each tier takes its own price, so the toggle is a few lines of your own state.
"use client";
import { useState } from "react";
import { Button } from "@/components/forme/button/button";
import {
Pricing,
PricingDescription,
PricingGrid,
PricingHeader,
PricingTier,
PricingTitle,
PricingToggle,
} from "@/components/forme/blocks/pricing/pricing";
const tiers = [
{
name: "Solo",
monthly: "$10",
annual: "$8",
description: "One person, one workspace, no seat maths.",
features: ["Every free component", "Unlimited projects", "Community support"],
},
{
name: "Team",
monthly: "$30",
annual: "$24",
description: "Shared components, shared tokens, one bill.",
features: [
"Everything in Solo",
"Shared component registry",
"Role based access",
"Deploy previews",
"Email support",
],
},
{
name: "Company",
monthly: "$90",
annual: "$72",
description: "For organisations that ship their own design system.",
features: [
"Everything in Team",
"Private registry",
"SAML single sign-on",
"Audit log",
"Priority support",
],
},
];
export function PricingDemo() {
const [annual, setAnnual] = useState(true);
return (
<div className="flex flex-col gap-8">
<Pricing>
<PricingHeader>
<PricingTitle>Pricing</PricingTitle>
<PricingDescription>
One price per seat, no feature gates on the free tier. Annual billing takes two months
off, and the component you copied in stays yours either way.
</PricingDescription>
</PricingHeader>
<div className="flex justify-center">
<PricingToggle annual={annual} onAnnualChange={setAnnual} annualNote="Save 20%" />
</div>
<PricingGrid>
{tiers.map((tier) => (
<PricingTier
key={tier.name}
name={tier.name}
price={annual ? tier.annual : tier.monthly}
period="per seat, per month"
description={tier.description}
features={tier.features}
featured={tier.name === "Team"}
>
<Button
variant={tier.name === "Team" ? "primary" : "secondary"}
className="w-full"
asChild
>
<a href="https://formeui.com">
{tier.name === "Solo" ? "Start free" : "Start trial"}
</a>
</Button>
</PricingTier>
))}
</PricingGrid>
</Pricing>
<p className="text-center text-caption-1-regular text-muted-foreground">
Prices in USD, excluding tax. Cancel whenever you like.
</p>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
PricingToggle
Controlled on purpose: the prices are the caller's to compute, so the toggle never has to know what a tier costs.
| Prop | Type | Default | Description |
|---|---|---|---|
annual* | boolean | — | |
onAnnualChange* | (annual: boolean) => void | — | |
monthlyLabel | string | "Monthly" | |
annualLabel | string | "Annual" | |
annualNote | string | — | Small note on the annual option, e.g. "Save 20%". |
PricingTier
| Prop | Type | Default | Description |
|---|---|---|---|
name* | string | — | |
price* | string | — | What the period costs, e.g. "$24". |
features* | string[] | — | |
period | string | — | What that price is measured in, e.g. "per seat, per month". |
description | ReactNode | — | |
featured | boolean | false | A stronger border and a label. Deliberately not a coloured card. |
children | ReactNode | — | The call to action, usually a Button. |
Also takes every prop of <div> attributes.
The other parts
PricingTakes<section>attributesPricingHeaderTakes<div>attributesPricingTitleTakes<h2>attributesPricingDescriptionTakes<p>attributesPricingGridTakes<div>attributes