Pricing blocks
Subscription plans, a single offer, and a usage estimator that shows its arithmetic.
Prices say what they cover and when you are charged. Figures are formatted for the locale and currency you pass.
Three plans with annual billing
Names, prices, actions, and lists share rows across all three plans. The yearly price states the total you are charged, not only the monthly equivalent.
"use client"
import * as React from "react"
import { Check as CheckIcon } from "honestui/icons"
import { cn } from "@/lib/utils"
import {
BillingToggle,
type Billing,
} from "@/components/marketing/foundation/billing-toggle"
import {
MarketingContainer,
MarketingSection,
} from "@/components/marketing/foundation/section"
import { SectionHeading } from "@/components/marketing/foundation/section-heading"
import type { MarketingAction } from "@/components/marketing/foundation/types"
import { Button } from "@/components/ui/button"
interface PricingPlan {
name: string
description: string
/** Per unit, per month, when billed monthly. */
monthly: number
/** Per unit, per month, when billed yearly. */
yearly: number
/** What one price covers, such as "person". Leave out for a flat price. */
unit?: string
action: MarketingAction
/** A line above the list, such as "Everything in Solo, and". */
includes?: string
features: string[]
/** A short reason. Marks the plan you recommend. */
recommended?: string
}
interface PricingThreePlansProps {
title?: React.ReactNode
description?: React.ReactNode
plans?: PricingPlan[]
currency?: string
locale?: string
defaultBilling?: Billing
yearlyNote?: string
note?: React.ReactNode
/** An anchor for links within the page. */
id?: string
className?: string
}
const DEFAULT_PLANS: PricingPlan[] = [
{
name: "Solo",
description: "For one person with documents other people sign.",
monthly: 0,
yearly: 0,
action: { label: "Start free", href: "#start" },
includes: "Includes",
features: ["10 active documents", "3 reviewers per document", "Version history for 30 days"],
},
{
name: "Team",
description: "For a team that approves things every week.",
monthly: 15,
yearly: 12,
unit: "person",
action: { label: "Try Team for 14 days", href: "#trial" },
includes: "Everything in Solo, and",
features: [
"Unlimited documents and reviewers",
"Approval steps and due dates",
"Full version history",
"Slack and email reminders",
],
recommended: "Most teams start here",
},
{
name: "Company",
description: "For work that has to stand up to an audit.",
monthly: 25,
yearly: 20,
unit: "person",
action: { label: "Talk to sales", href: "#sales" },
includes: "Everything in Team, and",
features: [
"Audit export and retention rules",
"Single sign-on and SCIM",
"Data kept in the EU or the US",
"A named person for support",
],
},
]
/**
* Three plans on one grid. Names, prices, actions, and lists share their rows,
* so the eye can compare across without hunting.
*/
export function PricingThreePlans({
title = "Pay for the people who write.",
description = "Reviewers are free on every plan, inside and outside your company.",
plans = DEFAULT_PLANS,
currency = "USD",
locale = "en-US",
defaultBilling = "yearly",
yearlyNote = "Save 20%",
note = "Prices exclude tax. Change or cancel at the end of any billing period.",
id,
className,
}: PricingThreePlansProps) {
const titleId = React.useId()
const [billing, setBilling] = React.useState<Billing>(defaultBilling)
const money = React.useMemo(
() =>
new Intl.NumberFormat(locale, {
style: "currency",
currency,
maximumFractionDigits: 2,
minimumFractionDigits: 0,
}),
[currency, locale]
)
const basis = (plan: PricingPlan) => {
if (plan.monthly === 0) return "Free, with no card"
const per = plan.unit ? ` per ${plan.unit}` : ""
return billing === "yearly"
? `${money.format(plan.yearly * 12)}${per}, billed once a year`
: `Billed every month${per && `, ${per.trim()}`}`
}
return (
<MarketingSection aria-labelledby={titleId} id={id} className={className}>
<MarketingContainer>
<div className="flex flex-col gap-x-10 gap-y-7 md:flex-row md:items-end md:justify-between">
<SectionHeading titleId={titleId} title={title} description={description} />
<BillingToggle
value={billing}
onValueChange={setBilling}
yearlyNote={yearlyNote}
className="self-start md:self-auto"
/>
</div>
<ul className="m-0 mt-(--mkt-head-gap) grid list-none gap-3 p-0 lg:grid-cols-3 lg:grid-rows-[repeat(5,auto)] lg:gap-x-0 lg:gap-y-0 lg:rounded-(--mkt-radius-panel) lg:bg-(--mkt-wash) lg:p-2">
{plans.map((plan) => (
<li
key={plan.name}
className={cn(
"grid content-start rounded-(--mkt-radius-panel) p-6 sm:p-8 lg:row-span-5 lg:grid-rows-subgrid lg:rounded-[calc(var(--mkt-radius-panel)-0.5rem)]",
plan.recommended
? "bg-(--mkt-frame) shadow-[0_0_0_0.5px_var(--mkt-line-strong),0_4px_16px_-6px_rgb(0_0_0/0.1)]"
: "bg-(--mkt-wash) lg:bg-transparent"
)}
>
<div className="flex flex-wrap items-baseline justify-between gap-x-4">
<h3 data-slot="plan-name" className="mkt-title text-(--mkt-ink)">
{plan.name}
</h3>
{plan.recommended && (
<p className="m-0 text-[0.875rem] leading-5 text-(--mkt-accent-ink) [font-weight:500]">
{plan.recommended}
</p>
)}
</div>
<p className="mkt-body mt-1.5 max-w-[22rem] [font-size:0.9375rem]">
{plan.description}
</p>
<div className="mt-8">
<p className="m-0 flex items-baseline gap-2">
<span className="text-[3rem] leading-[3.25rem] tracking-[-0.05em] text-(--mkt-ink) tabular-nums [font-weight:500]">
{money.format(billing === "yearly" ? plan.yearly : plan.monthly)}
</span>
{plan.unit && (
<span className="mkt-meta">per {plan.unit}, a month</span>
)}
</p>
<p className="mkt-meta mt-1 tabular-nums" aria-live="polite">
{basis(plan)}
</p>
</div>
<div className="mt-6">
<Button
size="lg"
variant={plan.action.variant ?? (plan.recommended ? "default" : "outline")}
className="w-full [font-size:0.9375rem]"
render={<a href={plan.action.href} />}
>
{plan.action.label}
<span className="sr-only">, {plan.name} plan</span>
</Button>
</div>
<div className="mt-8">
{plan.includes && <p className="mkt-meta mb-3">{plan.includes}</p>}
<ul className="m-0 grid list-none gap-2.5 p-0">
{plan.features.map((feature) => (
<li
key={feature}
className="flex gap-2.5 text-[0.9375rem] leading-6 tracking-[-0.008em] text-(--mkt-ink)"
>
<CheckIcon
aria-hidden="true"
className="mt-1 size-4 shrink-0 text-(--mkt-ink-soft)"
/>
{feature}
</li>
))}
</ul>
</div>
</li>
))}
</ul>
{note && <p className="mkt-meta mt-5">{note}</p>}
</MarketingContainer>
</MarketingSection>
)
}
export type { PricingPlan, PricingThreePlansProps }
Single offer
One price with room around it, beside everything it includes.
import * as React from "react"
import { Check as CheckIcon } from "honestui/icons"
import { ActionGroup } from "@/components/marketing/foundation/action-group"
import {
MarketingContainer,
MarketingSection,
} from "@/components/marketing/foundation/section"
import { SectionHeading } from "@/components/marketing/foundation/section-heading"
import type { MarketingAction } from "@/components/marketing/foundation/types"
interface PricingSingleOfferProps {
title?: React.ReactNode
description?: React.ReactNode
name?: string
/** Already formatted, such as "€6,500". */
price?: string
/** What the price covers and how it is paid. */
basis?: string
actions?: MarketingAction[]
note?: React.ReactNode
includesLabel?: string
includes?: { title: string; description?: string }[]
/** An anchor for links within the page. */
id?: string
className?: string
}
const DEFAULT_INCLUDES = [
{
title: "Two days on site",
description: "We walk it with the people who run it, and with a few who visit.",
},
{
title: "Every sign, page and print item, reviewed",
description: "Photographed, sorted and marked keep, change or remove.",
},
{
title: "A plan in order of effect",
description: "What to fix first, what it costs, and what can wait a year.",
},
{
title: "One session to hand it over",
description: "Ninety minutes with whoever needs to agree.",
},
]
/** One thing to buy, its price, and everything the price includes. */
export function PricingSingleOffer({
title = "One week, one clear plan.",
description = "A fixed-price review for museums, hotels and towns that know something is off and want to know where to start.",
name = "Place review",
price = "€6,500",
basis = "One payment, travel inside the EU included",
actions = [{ label: "Book a week", href: "#book" }],
note = "If you hire us afterwards, the fee comes off the first invoice.",
includesLabel = "What you get",
includes = DEFAULT_INCLUDES,
id,
className,
}: PricingSingleOfferProps) {
const titleId = React.useId()
return (
<MarketingSection aria-labelledby={titleId} id={id} className={className}>
<MarketingContainer>
<SectionHeading align="split" titleId={titleId} title={title} description={description} />
<div className="mt-(--mkt-head-gap) grid gap-2 rounded-(--mkt-radius-panel) bg-(--mkt-wash) p-2 lg:grid-cols-12">
<div className="flex flex-col rounded-[calc(var(--mkt-radius-panel)-0.5rem)] bg-(--mkt-frame) p-6 shadow-[0_0_0_0.5px_var(--mkt-line-strong)] sm:p-9 lg:col-span-5 lg:p-11">
<h3 data-slot="offer-name" className="mkt-title text-(--mkt-ink)">
{name}
</h3>
<p className="m-0 mt-8 text-[clamp(3.25rem,2.4rem+3.600vw,4.750rem)] leading-none tracking-[-0.055em] text-(--mkt-ink) tabular-nums [font-weight:500] lg:mt-auto lg:pt-24">
{price}
</p>
<p className="mkt-body mt-3">{basis}</p>
<ActionGroup actions={actions} className="mt-8 *:grow" />
{note && <p className="mkt-meta mt-5">{note}</p>}
</div>
<div className="p-6 sm:p-9 lg:col-span-7 lg:p-11">
<p className="mkt-meta">{includesLabel}</p>
<ul className="m-0 mt-3 list-none p-0">
{includes.map((item) => (
<li
key={item.title}
className="flex gap-4 border-b-[0.5px] border-(--mkt-line-strong) py-5 last:border-b-0 last:pb-0"
>
<CheckIcon
aria-hidden="true"
className="mt-1 size-4.5 shrink-0 text-(--mkt-accent-ink)"
/>
<span>
<span className="block text-[1.0625rem] leading-6.5 tracking-[-0.014em] text-(--mkt-ink) [font-weight:500]">
{item.title}
</span>
{item.description && (
<span className="mkt-body mt-0.5 block">{item.description}</span>
)}
</span>
</li>
))}
</ul>
</div>
</div>
</MarketingContainer>
</MarketingSection>
)
}
export type { PricingSingleOfferProps }
Usage-based pricing
A slider for a feel and a field for the exact number. The breakdown shows each tier, its rate, and what it adds. Past the last tier, the total gives way to a contact action.
"use client"
import * as React from "react"
import { ActionGroup } from "@/components/marketing/foundation/action-group"
import {
MarketingContainer,
MarketingSection,
} from "@/components/marketing/foundation/section"
import { SectionHeading } from "@/components/marketing/foundation/section-heading"
import type { MarketingAction } from "@/components/marketing/foundation/types"
import { Field, FieldDescription, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { Slider } from "@/components/ui/slider"
interface UsageTier {
/** The last unit this rate applies to. */
upTo: number
/** Price for each thousand units in this tier. Zero means included. */
perThousand: number
}
interface PricingUsageProps {
title?: React.ReactNode
description?: React.ReactNode
/** What you count, in the plural. */
unit?: string
/** A sentence that says exactly what counts as one. */
unitDefinition?: string
/** What is counted, what is not, and when it is charged. */
assumptions?: { label: string; text: string }[]
base?: { label: string; price: number }
tiers?: UsageTier[]
min?: number
/** Above this, the estimate gives way to a conversation. */
max?: number
defaultValue?: number
currency?: string
locale?: string
action?: MarketingAction
contact?: MarketingAction
/** An anchor for links within the page. */
id?: string
className?: string
}
const DEFAULT_TIERS: UsageTier[] = [
{ upTo: 100_000, perThousand: 0 },
{ upTo: 1_000_000, perThousand: 0.4 },
{ upTo: 5_000_000, perThousand: 0.25 },
{ upTo: 20_000_000, perThousand: 0.15 },
]
const DEFAULT_ASSUMPTIONS = [
{ label: "Counted", text: "Deliveries your endpoint accepts" },
{ label: "Free", text: "Retries, replays and test traffic" },
{ label: "Billed", text: "On the first of the month, for the month before" },
]
/** Two significant digits, so the slider lands on numbers people say out loud. */
const tidy = (value: number) => {
const power = 10 ** Math.max(0, Math.floor(Math.log10(value)) - 1)
return Math.round(value / power) * power
}
function price(value: number, tiers: UsageTier[]) {
let from = 0
return tiers.map((tier) => {
const units = Math.max(0, Math.min(value, tier.upTo) - from)
const row = { ...tier, from, units, cost: (units / 1000) * tier.perThousand }
from = tier.upTo
return row
})
}
/**
* A slider for a feel, a field for the exact number, and the arithmetic in
* view. Larger volumes get a person instead of a made-up total.
*/
export function PricingUsage({
title = "Pay for what you deliver.",
description = "Spool charges for delivered events. The rate falls as you send more.",
unit = "events",
unitDefinition = "One event is one webhook your endpoint accepts, up to 64 KB.",
assumptions = DEFAULT_ASSUMPTIONS,
base = { label: "Base plan", price: 20 },
tiers = DEFAULT_TIERS,
min = 10_000,
max = 20_000_000,
defaultValue = 2_500_000,
currency = "USD",
locale = "en-US",
action = { label: "Start with 100,000 free", href: "#start" },
contact = { label: "Talk to us about volume", href: "#sales" },
id,
className,
}: PricingUsageProps) {
const titleId = React.useId()
const [value, setValue] = React.useState(defaultValue)
const [draft, setDraft] = React.useState<string | null>(null)
const count = React.useMemo(() => new Intl.NumberFormat(locale), [locale])
const short = React.useMemo(
() => new Intl.NumberFormat(locale, { notation: "compact", maximumFractionDigits: 1 }),
[locale]
)
const money = React.useMemo(
() => new Intl.NumberFormat(locale, { style: "currency", currency }),
[currency, locale]
)
const overMax = value > max
const rows = price(Math.min(value, max), tiers)
const total = base.price + rows.reduce((sum, row) => sum + row.cost, 0)
// The slider moves through orders of magnitude, so small amounts get room.
const span = Math.log(max / min)
const position = (Math.log(Math.min(Math.max(value, min), max) / min) / span) * 1000
const commit = (text: string) => {
const next = Number(text.replace(/[^\d]/g, ""))
if (next > 0) setValue(next)
}
return (
<MarketingSection aria-labelledby={titleId} id={id} className={className}>
<MarketingContainer>
<SectionHeading align="split" titleId={titleId} title={title} description={description} />
<div className="mt-(--mkt-head-gap) grid gap-2 rounded-(--mkt-radius-panel) bg-(--mkt-wash) p-2 lg:grid-cols-12">
<div className="mkt-form flex flex-col p-5 sm:p-9 lg:col-span-6 lg:p-11">
<Field className="gap-2">
<FieldLabel className="[font-size:1rem] [line-height:1.5rem]">
<span className="first-letter:uppercase">{unit} each month</span>
</FieldLabel>
<Input
inputMode="numeric"
autoComplete="off"
size="lg"
className="max-w-[16rem]"
value={draft ?? count.format(value)}
onChange={(event) => {
setDraft(event.currentTarget.value)
commit(event.currentTarget.value)
}}
onBlur={() => setDraft(null)}
/>
<FieldDescription>{unitDefinition}</FieldDescription>
</Field>
<div className="mt-8">
<Slider
className="pointer-coarse:[&_[data-slot=slider-control]]:h-11!"
min={0}
max={1000}
step={1}
value={position}
onValueChange={(next) => {
const at = Array.isArray(next) ? next[0] : next
setDraft(null)
setValue(
Math.min(max, Math.max(min, tidy(min * Math.exp((at / 1000) * span))))
)
}}
getAriaLabel={() => `${unit} each month`}
getAriaValueText={() => `${count.format(value)} ${unit}`}
/>
<div className="mkt-meta mt-1 flex justify-between tabular-nums">
<span>{short.format(min)}</span>
<span>{short.format(max)}</span>
</div>
</div>
{assumptions.length > 0 && (
<dl className="m-0 mt-10 lg:mt-auto lg:pt-12">
{assumptions.map((item) => (
<div
key={item.label}
className="grid grid-cols-[5.5rem_1fr] items-baseline border-t-[0.5px] border-(--mkt-line-strong) py-3 last:pb-0"
>
<dt className="mkt-meta">{item.label}</dt>
<dd className="m-0 text-[0.9375rem] leading-6 tracking-[-0.008em]">
{item.text}
</dd>
</div>
))}
</dl>
)}
</div>
<div className="flex min-h-[29rem] flex-col rounded-[calc(var(--mkt-radius-panel)-0.5rem)] bg-(--mkt-frame) p-5 shadow-[0_0_0_0.5px_var(--mkt-line-strong)] sm:p-9 lg:col-span-6 lg:p-11">
<p className="mkt-meta">Estimated monthly total</p>
<output
aria-live="polite"
className="mt-1 block text-[clamp(2.500rem,2rem+2.200vw,3.500rem)] leading-[1.1] tracking-[-0.05em] text-(--mkt-ink) tabular-nums [font-weight:500]"
>
{overMax ? "Let’s talk" : money.format(total)}
</output>
<p className="mkt-meta mt-1 tabular-nums">
{overMax
? `Above ${short.format(max)} ${unit}, rates are agreed together`
: `For ${count.format(value)} ${unit}, before tax`}
</p>
<table className="mt-8 w-full border-collapse text-[0.9375rem] leading-6 tracking-[-0.008em]">
<caption className="sr-only">How the estimate is calculated</caption>
<tbody>
<tr className="border-t-[0.5px] border-(--mkt-line-strong)">
<th scope="row" className="py-2.5 text-start font-normal text-(--mkt-ink)">
{base.label}
</th>
<td className="py-2.5 text-end text-(--mkt-ink-soft)">Every month</td>
<td className="w-[6.5rem] py-2.5 text-end text-(--mkt-ink) tabular-nums">
{money.format(base.price)}
</td>
</tr>
{rows.map((row) => (
<tr
key={row.upTo}
className={
row.units === 0 && !overMax
? "border-t-[0.5px] border-(--mkt-line-strong) text-(--mkt-ink-soft)"
: "border-t-[0.5px] border-(--mkt-line-strong) text-(--mkt-ink)"
}
>
<th scope="row" className="py-2.5 text-start font-normal tabular-nums">
{row.from === 0
? `First ${short.format(row.upTo)}`
: `${short.format(row.from)} to ${short.format(row.upTo)}`}
</th>
<td className="py-2.5 text-end text-(--mkt-ink-soft) tabular-nums">
{row.perThousand === 0 ? "Included" : `${money.format(row.perThousand)} per 1K`}
</td>
<td className="w-[6.5rem] py-2.5 text-end tabular-nums">
{overMax ? "" : money.format(row.cost)}
</td>
</tr>
))}
</tbody>
</table>
<div className="mt-auto pt-8">
<ActionGroup
actions={overMax ? [contact] : [action]}
className="*:w-full"
/>
</div>
</div>
</div>
</MarketingContainer>
</MarketingSection>
)
}
export type { PricingUsageProps, UsageTier }
Usage
Every prop has a default, so a block renders as soon as it is installed. Pass your own content to replace it.
import { PricingThreePlans } from "@/components/marketing/pricing-three-plans"
<PricingThreePlans
currency="EUR"
locale="de-DE"
defaultBilling="monthly"
plans={plans}
/>