Pricing
Three plans with patterned headers, a monthly and yearly switch that changes the prices, and one plan picked out.
Plans
Move up when your team grows.
More than 200 people? Talk to us about Enterprise.
Options
Code
import { useState } from "react";
import "./pricing.css";
const plans = [
{ name: "Solo", art: "dots", monthly: "£4", yearly: "£40",
about: "One workspace, unlimited notes and a week of history." },
{ name: "Team", art: "rings", monthly: "£8", yearly: "£80", popular: true,
about: "Unlimited workspaces, shared decisions and a year of history." },
{ name: "Company", art: "grid", monthly: "£16", yearly: "£160",
about: "Single sign-on, an audit log and history that never expires." },
];
export function Pricing() {
const [period, setPeriod] = useState("yearly");
return (
<section className="dh-pricing">
<header className="dh-pricing-head">
<div>
<h2>Plans</h2>
<p>Move up when your team grows.</p>
</div>
<div className="dh-pricing-switch" role="radiogroup" aria-label="Billing period">
<button type="button" role="radio" aria-checked={period === "monthly"} onClick={() => setPeriod("monthly")}>
Monthly
</button>
<button type="button" role="radio" aria-checked={period === "yearly"} onClick={() => setPeriod("yearly")}>
Yearly <span>2 months free</span>
</button>
</div>
</header>
<div className="dh-pricing-plans">
{plans.map((plan) => (
<article key={plan.name}>
<div className={"dh-pricing-art dh-pricing-art--" + plan.art} aria-hidden="true" />
{plan.popular && <span className="dh-pricing-flag">Popular</span>}
<div className="dh-pricing-body">
<div className="dh-pricing-title">
<h3>{plan.name}</h3>
<p className="dh-pricing-price">
<b>{plan[period]}</b> {period === "yearly" ? "a year" : "a month"}
</p>
</div>
<p>{plan.about}</p>
<a className={plan.popular ? "dh-pricing-primary" : undefined} href="#">
Choose {plan.name}
</a>
</div>
</article>
))}
</div>
<p className="dh-pricing-foot">
More than 200 people? <a href="#">Talk to us about Enterprise</a>.
</p>
</section>
);
}.dh-pricing {
--dh-pricing-tint: color-mix(in srgb, var(--dh-accent, #2563ff) 45%, transparent);
--dh-pricing-line: color-mix(in srgb, var(--dh-accent, #2563ff) 55%, transparent);
container-type: inline-size;
padding: 56px 32px;
background: var(--dh-bg, #fff);
color: var(--dh-fg, #171717);
font-size: 14px;
line-height: 1.5;
}
.dh-pricing-head,
.dh-pricing-plans,
.dh-pricing-foot {
max-width: 1040px;
margin-left: auto;
margin-right: auto;
}
.dh-pricing-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 24px;
}
.dh-pricing h2 {
margin: 0;
font-size: 16px;
font-weight: 500;
}
.dh-pricing-head p {
margin: 6px 0 0;
color: var(--dh-muted, #5c5c5c);
}
.dh-pricing-switch {
display: flex;
padding: 3px;
border-radius: 10px;
background: var(--dh-well, #ededeb);
box-shadow: inset 0 0 0 1px var(--dh-edge, #d6d6d2);
}
.dh-pricing-switch button {
height: 32px;
padding: 0 14px;
border: 0;
border-radius: 7px;
background: transparent;
color: var(--dh-muted, #5c5c5c);
font: inherit;
font-weight: 500;
white-space: nowrap;
cursor: pointer;
}
.dh-pricing-switch button[aria-checked="true"] {
background: var(--dh-raised, #fff);
color: var(--dh-fg, #171717);
box-shadow: 0 0 0 1px var(--dh-edge, #d6d6d2), 0 1px 2px rgb(0 0 0 / 0.12);
}
.dh-pricing-switch span {
margin-left: 6px;
color: color-mix(in srgb, var(--dh-accent, #2563ff) 70%, var(--dh-fg, #171717));
}
.dh-pricing-switch button:focus-visible,
.dh-pricing a:focus-visible {
outline: 2px solid var(--dh-faint, #8a8a8a);
outline-offset: 2px;
}
.dh-pricing-plans {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 14px;
margin-top: 20px;
}
.dh-pricing article {
position: relative;
display: flex;
flex-direction: column;
overflow: hidden;
border-radius: 14px;
background: var(--dh-raised, #fff);
box-shadow: 0 0 0 1px var(--dh-edge, #d6d6d2), 0 1px 2px rgb(0 0 0 / 0.06);
}
.dh-pricing-art {
height: 96px;
-webkit-mask-image: linear-gradient(#000 20%, transparent);
mask-image: linear-gradient(#000 20%, transparent);
}
.dh-pricing-art--dots {
background:
radial-gradient(circle, var(--dh-pricing-line) 1px, transparent 1.5px) 0 0 / 13px 13px,
radial-gradient(120% 140% at 0 0, var(--dh-pricing-tint), transparent 60%);
}
.dh-pricing-art--rings {
background:
repeating-radial-gradient(circle at 50% -40%, transparent 0 11px, var(--dh-pricing-line) 11px 12px),
radial-gradient(70% 130% at 50% 0, var(--dh-pricing-tint), transparent 70%);
}
.dh-pricing-art--grid {
background:
linear-gradient(var(--dh-pricing-line) 1px, transparent 1px) 0 0 / 100% 16px,
linear-gradient(90deg, var(--dh-pricing-line) 1px, transparent 1px) 0 0 / 16px 100%,
radial-gradient(120% 140% at 100% 0, var(--dh-pricing-tint), transparent 60%);
-webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 60%);
mask-image: linear-gradient(200deg, #000 10%, transparent 60%);
}
.dh-pricing-flag {
position: absolute;
top: 12px;
right: 12px;
padding: 2px 10px;
border-radius: 999px;
background: var(--dh-raised, #fff);
font-size: 12px;
font-weight: 500;
box-shadow: 0 0 0 1px var(--dh-edge, #d6d6d2), 0 1px 2px rgb(0 0 0 / 0.12);
}
.dh-pricing-body {
display: flex;
flex: 1;
flex-direction: column;
padding: 4px 16px 16px;
}
.dh-pricing-title {
display: flex;
align-items: center;
gap: 8px;
}
.dh-pricing h3 {
margin: 0;
font-size: 15px;
font-weight: 500;
}
.dh-pricing-title svg {
width: 14px;
height: 14px;
fill: color-mix(in srgb, var(--dh-accent, #2563ff) 75%, var(--dh-bg, #fff));
}
.dh-pricing-price {
margin: 0 0 0 auto;
color: var(--dh-muted, #5c5c5c);
font-size: 15px;
white-space: nowrap;
}
.dh-pricing-price b {
color: var(--dh-fg, #171717);
font-weight: 500;
font-variant-numeric: tabular-nums;
}
.dh-pricing-body > p {
margin: 6px 0 16px;
color: var(--dh-muted, #5c5c5c);
}
.dh-pricing-body > a {
display: flex;
align-items: center;
justify-content: center;
height: 36px;
margin-top: auto;
border-radius: 9px;
background: var(--dh-raised, #fff);
color: var(--dh-fg, #171717);
font-weight: 500;
text-decoration: none;
box-shadow: 0 0 0 1px var(--dh-edge, #d6d6d2), 0 1px 2px rgb(0 0 0 / 0.14);
}
.dh-pricing-body > a.dh-pricing-primary {
background: linear-gradient(color-mix(in srgb, var(--dh-accent, #2563ff) 86%, #fff), var(--dh-accent, #2563ff));
color: var(--dh-on-accent, #fff);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 1px 2px rgb(0 0 0 / 0.25);
}
.dh-pricing-foot {
margin-top: 20px;
margin-bottom: 0;
color: var(--dh-muted, #5c5c5c);
}
.dh-pricing-foot a {
color: var(--dh-fg, #171717);
text-underline-offset: 3px;
}
@container (max-width: 720px) {
.dh-pricing { padding: 40px 20px; }
.dh-pricing-head { flex-direction: column; align-items: stretch; }
.dh-pricing-switch button { flex: 1; height: 40px; }
.dh-pricing-plans { grid-template-columns: 1fr; }
.dh-pricing-body > a { height: 44px; }
}<section class="dh-pricing">
<header class="dh-pricing-head">
<div>
<h2>Plans</h2>
<p>Move up when your team grows.</p>
</div>
<div class="dh-pricing-switch" role="radiogroup" aria-label="Billing period">
<button type="button" role="radio" aria-checked="false" data-period="monthly">Monthly</button>
<button type="button" role="radio" aria-checked="true" data-period="yearly">Yearly <span>2 months free</span></button>
</div>
</header>
<div class="dh-pricing-plans">
<article>
<div class="dh-pricing-art dh-pricing-art--dots" aria-hidden="true"></div>
<div class="dh-pricing-body">
<div class="dh-pricing-title">
<h3>Solo</h3>
<svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="4" cy="4" r="3"/><circle cx="12" cy="4" r="3"/><circle cx="4" cy="12" r="3"/><circle cx="12" cy="12" r="3"/></svg>
<p class="dh-pricing-price"><b data-monthly="£4" data-yearly="£40">£40</b> <span data-monthly="a month" data-yearly="a year">a year</span></p>
</div>
<p>One workspace, unlimited notes and a week of history.</p>
<a href="#">Choose Solo</a>
</div>
</article>
<article>
<div class="dh-pricing-art dh-pricing-art--rings" aria-hidden="true"></div>
<span class="dh-pricing-flag">Popular</span>
<div class="dh-pricing-body">
<div class="dh-pricing-title">
<h3>Team</h3>
<svg viewBox="0 0 16 16" aria-hidden="true"><path fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1Zm0 2a5 5 0 1 1 0 10A5 5 0 0 1 8 3Z"/><circle cx="8" cy="8" r="3"/></svg>
<p class="dh-pricing-price"><b data-monthly="£8" data-yearly="£80">£80</b> <span data-monthly="a month" data-yearly="a year">a year</span></p>
</div>
<p>Unlimited workspaces, shared decisions and a year of history.</p>
<a class="dh-pricing-primary" href="#">Choose Team</a>
</div>
</article>
<article>
<div class="dh-pricing-art dh-pricing-art--grid" aria-hidden="true"></div>
<div class="dh-pricing-body">
<div class="dh-pricing-title">
<h3>Company</h3>
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1 1h4v4H1zM6 1h4v4H6zM11 1h4v4h-4zM1 6h4v4H1zM6 6h4v4H6zM11 6h4v4h-4zM1 11h4v4H1zM6 11h4v4H6zM11 11h4v4h-4z"/></svg>
<p class="dh-pricing-price"><b data-monthly="£16" data-yearly="£160">£160</b> <span data-monthly="a month" data-yearly="a year">a year</span></p>
</div>
<p>Single sign-on, an audit log and history that never expires.</p>
<a href="#">Choose Company</a>
</div>
</article>
</div>
<p class="dh-pricing-foot">More than 200 people? <a href="#">Talk to us about Enterprise</a>.</p>
</section>.dh-pricing {
--dh-pricing-tint: color-mix(in srgb, var(--dh-accent, #2563ff) 45%, transparent);
--dh-pricing-line: color-mix(in srgb, var(--dh-accent, #2563ff) 55%, transparent);
container-type: inline-size;
padding: 56px 32px;
background: var(--dh-bg, #fff);
color: var(--dh-fg, #171717);
font-size: 14px;
line-height: 1.5;
}
.dh-pricing-head,
.dh-pricing-plans,
.dh-pricing-foot {
max-width: 1040px;
margin-left: auto;
margin-right: auto;
}
.dh-pricing-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 24px;
}
.dh-pricing h2 {
margin: 0;
font-size: 16px;
font-weight: 500;
}
.dh-pricing-head p {
margin: 6px 0 0;
color: var(--dh-muted, #5c5c5c);
}
.dh-pricing-switch {
display: flex;
padding: 3px;
border-radius: 10px;
background: var(--dh-well, #ededeb);
box-shadow: inset 0 0 0 1px var(--dh-edge, #d6d6d2);
}
.dh-pricing-switch button {
height: 32px;
padding: 0 14px;
border: 0;
border-radius: 7px;
background: transparent;
color: var(--dh-muted, #5c5c5c);
font: inherit;
font-weight: 500;
white-space: nowrap;
cursor: pointer;
}
.dh-pricing-switch button[aria-checked="true"] {
background: var(--dh-raised, #fff);
color: var(--dh-fg, #171717);
box-shadow: 0 0 0 1px var(--dh-edge, #d6d6d2), 0 1px 2px rgb(0 0 0 / 0.12);
}
.dh-pricing-switch span {
margin-left: 6px;
color: color-mix(in srgb, var(--dh-accent, #2563ff) 70%, var(--dh-fg, #171717));
}
.dh-pricing-switch button:focus-visible,
.dh-pricing a:focus-visible {
outline: 2px solid var(--dh-faint, #8a8a8a);
outline-offset: 2px;
}
.dh-pricing-plans {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 14px;
margin-top: 20px;
}
.dh-pricing article {
position: relative;
display: flex;
flex-direction: column;
overflow: hidden;
border-radius: 14px;
background: var(--dh-raised, #fff);
box-shadow: 0 0 0 1px var(--dh-edge, #d6d6d2), 0 1px 2px rgb(0 0 0 / 0.06);
}
.dh-pricing-art {
height: 96px;
-webkit-mask-image: linear-gradient(#000 20%, transparent);
mask-image: linear-gradient(#000 20%, transparent);
}
.dh-pricing-art--dots {
background:
radial-gradient(circle, var(--dh-pricing-line) 1px, transparent 1.5px) 0 0 / 13px 13px,
radial-gradient(120% 140% at 0 0, var(--dh-pricing-tint), transparent 60%);
}
.dh-pricing-art--rings {
background:
repeating-radial-gradient(circle at 50% -40%, transparent 0 11px, var(--dh-pricing-line) 11px 12px),
radial-gradient(70% 130% at 50% 0, var(--dh-pricing-tint), transparent 70%);
}
.dh-pricing-art--grid {
background:
linear-gradient(var(--dh-pricing-line) 1px, transparent 1px) 0 0 / 100% 16px,
linear-gradient(90deg, var(--dh-pricing-line) 1px, transparent 1px) 0 0 / 16px 100%,
radial-gradient(120% 140% at 100% 0, var(--dh-pricing-tint), transparent 60%);
-webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 60%);
mask-image: linear-gradient(200deg, #000 10%, transparent 60%);
}
.dh-pricing-flag {
position: absolute;
top: 12px;
right: 12px;
padding: 2px 10px;
border-radius: 999px;
background: var(--dh-raised, #fff);
font-size: 12px;
font-weight: 500;
box-shadow: 0 0 0 1px var(--dh-edge, #d6d6d2), 0 1px 2px rgb(0 0 0 / 0.12);
}
.dh-pricing-body {
display: flex;
flex: 1;
flex-direction: column;
padding: 4px 16px 16px;
}
.dh-pricing-title {
display: flex;
align-items: center;
gap: 8px;
}
.dh-pricing h3 {
margin: 0;
font-size: 15px;
font-weight: 500;
}
.dh-pricing-title svg {
width: 14px;
height: 14px;
fill: color-mix(in srgb, var(--dh-accent, #2563ff) 75%, var(--dh-bg, #fff));
}
.dh-pricing-price {
margin: 0 0 0 auto;
color: var(--dh-muted, #5c5c5c);
font-size: 15px;
white-space: nowrap;
}
.dh-pricing-price b {
color: var(--dh-fg, #171717);
font-weight: 500;
font-variant-numeric: tabular-nums;
}
.dh-pricing-body > p {
margin: 6px 0 16px;
color: var(--dh-muted, #5c5c5c);
}
.dh-pricing-body > a {
display: flex;
align-items: center;
justify-content: center;
height: 36px;
margin-top: auto;
border-radius: 9px;
background: var(--dh-raised, #fff);
color: var(--dh-fg, #171717);
font-weight: 500;
text-decoration: none;
box-shadow: 0 0 0 1px var(--dh-edge, #d6d6d2), 0 1px 2px rgb(0 0 0 / 0.14);
}
.dh-pricing-body > a.dh-pricing-primary {
background: linear-gradient(color-mix(in srgb, var(--dh-accent, #2563ff) 86%, #fff), var(--dh-accent, #2563ff));
color: var(--dh-on-accent, #fff);
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 1px 2px rgb(0 0 0 / 0.25);
}
.dh-pricing-foot {
margin-top: 20px;
margin-bottom: 0;
color: var(--dh-muted, #5c5c5c);
}
.dh-pricing-foot a {
color: var(--dh-fg, #171717);
text-underline-offset: 3px;
}
@container (max-width: 720px) {
.dh-pricing { padding: 40px 20px; }
.dh-pricing-head { flex-direction: column; align-items: stretch; }
.dh-pricing-switch button { flex: 1; height: 40px; }
.dh-pricing-plans { grid-template-columns: 1fr; }
.dh-pricing-body > a { height: 44px; }
}document.querySelectorAll(".dh-pricing").forEach((pricing) => {
const options = pricing.querySelectorAll(".dh-pricing-switch button");
options.forEach((option) => {
option.addEventListener("click", () => {
const period = option.dataset.period;
options.forEach((other) => other.setAttribute("aria-checked", String(other === option)));
pricing.querySelectorAll("[data-monthly]").forEach((text) => {
text.textContent = text.dataset[period];
});
});
});
});Pricing is a Figma component
- Open it in Figma.
- Copy the component (Cmd or Ctrl + C).
- Paste it into your own file.