Templates
Pricing
FreePlans side by side with a monthly or yearly switch, a highlighted plan and FAQs.
The download follows the framework picked above the code. Unzip it and run npm install, then npm run dev.
Live preview
Preview width
Code
import { useState } from "react";
import {
Accordion,
Badge,
Box,
Button,
Card,
CheckIcon,
Container,
Flex,
Grid,
Heading,
Link,
Navbar,
SegmentedControl,
Stack,
Text,
} from "@vjdesigns/vjdesigns-ui";
const plans = [
{
name: "Starter",
monthly: 0,
yearly: 0,
description: "For trying things out on your own.",
features: ["1 project", "Community support", "Basic analytics"],
},
{
name: "Team",
monthly: 24,
yearly: 19,
description: "For small teams shipping every week.",
features: ["Unlimited projects", "Up to 10 members", "Email support", "Advanced analytics"],
popular: true,
},
{
name: "Business",
monthly: 59,
yearly: 49,
description: "For companies with security and billing needs.",
features: ["Everything in Team", "Unlimited members", "SSO and audit log", "Priority support"],
},
];
const questions = [
{ q: "Can I change plans later?", a: "Yes. Upgrades take effect right away; downgrades at the end of your billing period." },
{ q: "Do you offer refunds?", a: "Yes, within 14 days of any payment, no questions asked." },
{ q: "Which payment methods do you accept?", a: "All major cards. Business plans can also pay by invoice." },
];
/** Plans side by side with a monthly or yearly switch, a highlighted plan, and FAQs. Prices are announced with their billing period, not just a number. */
export function PricingPage() {
const [billing, setBilling] = useState("yearly");
const yearly = billing === "yearly";
return (
<>
<Navbar position="sticky" collapseBelow="md" menuTitle="Acme">
<Navbar.Brand href="#home">Acme</Navbar.Brand>
<Navbar.Nav aria-label="Main">
<Navbar.Link href="#product">Product</Navbar.Link>
<Navbar.Link href="#pricing" active>
Pricing
</Navbar.Link>
<Navbar.Link href="#docs">Docs</Navbar.Link>
</Navbar.Nav>
<Navbar.Actions>
<Button size="sm" tone="primary" href="#sign-up">
Sign up
</Button>
</Navbar.Actions>
</Navbar>
<Container as="main" size="xl" gutter="responsive" py={12}>
<Stack gap={10}>
<Stack gap={4} align="center" style={{ textAlign: "center" }}>
<Heading level={1} size="4xl">
Simple pricing that grows with you
</Heading>
<Text size="lg" tone="muted" style={{ maxWidth: "36rem" }}>
Start free. Upgrade when your team does. Cancel any time.
</Text>
<SegmentedControl
label="Billing period"
value={billing}
onValueChange={setBilling}
options={[
{ value: "monthly", label: "Monthly" },
{ value: "yearly", label: "Yearly (save 20%)" },
]}
/>
</Stack>
<Grid columns={{ base: 1, md: 3 }} gap={6} align="start">
{plans.map((plan) => {
const price = yearly ? plan.yearly : plan.monthly;
return (
<Card key={plan.name} variant={plan.popular ? "elevated" : "outline"} padding="lg">
<Stack gap={5}>
<Flex align="center" justify="between" gap={2}>
<Heading level={2} size="xl">
{plan.name}
</Heading>
{plan.popular && <Badge tone="primary">Most popular</Badge>}
</Flex>
<Text tone="muted">{plan.description}</Text>
<Text>
<Text as="span" weight="bold" style={{ fontSize: "var(--font-size-4xl)", fontFamily: "var(--font-display)" }}>
${price}
</Text>{" "}
<Text as="span" tone="muted">
{price === 0 ? "free forever" : yearly ? "per member per month, billed yearly" : "per member per month"}
</Text>
</Text>
<Button href="#sign-up" tone="primary" variant={plan.popular ? "solid" : "outline"} fullWidth>
{price === 0 ? "Start for free" : `Choose ${plan.name}`}
</Button>
<Stack as="ul" gap={2} style={{ listStyle: "none", margin: 0, padding: 0 }}>
{plan.features.map((feature) => (
<Flex as="li" key={feature} gap={2} align="center">
<CheckIcon size="sm" tone="success" />
<Text>{feature}</Text>
</Flex>
))}
</Stack>
</Stack>
</Card>
);
})}
</Grid>
<Stack gap={4} style={{ maxWidth: "44rem", width: "100%", marginInline: "auto" }}>
<Heading level={2} size="2xl">
Questions
</Heading>
<Accordion>
{questions.map((item) => (
<Accordion.Item key={item.q} value={item.q}>
<Accordion.Trigger>{item.q}</Accordion.Trigger>
<Accordion.Content>
<Text tone="muted">{item.a}</Text>
</Accordion.Content>
</Accordion.Item>
))}
</Accordion>
</Stack>
</Stack>
</Container>
<Box as="footer" py={8} style={{ borderTop: "var(--border-width) solid var(--color-border)" }}>
<Container size="xl" gutter="responsive">
<Flex justify="between" gap={4} wrap="wrap">
<Text size="sm" tone="muted">
© Acme Inc.
</Text>
<Flex gap={4}>
<Link href="#terms" size="sm" variant="subtle">
Terms
</Link>
<Link href="#privacy" size="sm" variant="subtle">
Privacy
</Link>
</Flex>
</Flex>
</Container>
</Box>
</>
);
}