Components•Artifact panel
Make a pricing card for the Studio plan. Yearly should show the monthly price.
Here is a pricing card that takes a plan and shows the monthly equivalent for yearly billing.
Pricing card
component38 lines · tsx
v3 of 3
type Plan = { name: string; price: number; interval: "month" | "year"; features: string[]; popular?: boolean;};// Yearly plans show the monthly equivalent, billed once.function perMonth(plan: Plan) { return plan.interval === "year" ? plan.price / 12 : plan.price;}export function PricingCard({ plan, onChoose }: { plan: Plan; onChoose: () => void }) { return ( <article className="pricing-card" data-popular={plan.popular}> <header> <h3>{plan.name}</h3> {plan.popular && <span className="tag">Most popular</span>} </header> <p className="price"> <strong>${perMonth(plan).toFixed(0)}</strong> <span> / month</span> </p> <p className="billing"> {plan.interval === "year" ? `Billed ${plan.price} yearly` : "Billed monthly"} </p> <ul> {plan.features.map((feature) => ( <li key={feature}>{feature}</li> ))} </ul> <button type="button" onClick={onChoose}> Choose {plan.name} </button> </article> );}Studio
Most popular$12/ month
Billed $144 yearly
- Unlimited projects
- Version history, 90 days
- Shared libraries
- Priority support
Choose Studio
Options