Abstract angles
A heading and annual switch on a tinted band over three plan cards on a striped ground.
Last updated
---
/**
* Abstract angles: A heading and annual switch on a tinted band over three plan cards on a striped ground.
*
* @block pricing
* @order 17
*/
import { Check, Layers2, Layers3, Zap } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import Heading from '@/components/apogee/Heading/Heading.astro'
import Button from '@/components/apogee/Button/Button.astro'
import Badge from '@/components/apogee/Badge/Badge.astro'
import FeaturedIcon from '@/components/apogee/FeaturedIcon/FeaturedIcon.astro'
import Switch from '@/components/apogee/Switch/Switch.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { PricingContent } from '@/components/apogee/sections/_shared/pricing.ts'
/** @composable */
interface Props extends PricingContent {
/** 1 when the block opens a page; its items move one level down with it. */
headingLevel?: 1 | 2
}
// ponytail: one switch, so only `periods.annual` shows (as its label); `monthly` is unused here.
const {
headingLevel = 2,
eyebrow = 'Pricing plans',
heading = 'Plans for all sizes',
description = 'Simple, transparent pricing that grows with you. Try any plan free for 30 days.',
periods = { monthly: 'Monthly pricing', annual: 'Annual pricing (save 20%)' },
items = [
{ name: 'Basic plan', price: '$10', annualPrice: '$9', period: 'mth', description: 'Billed annually.', features: ['Access to all basic features', 'Basic reporting and analytics', 'Up to 10 individual users', '20 GB individual data', 'Basic chat and email support'], action: { label: 'Get started', href: '#' } },
{ name: 'Business plan', price: '$20', annualPrice: '$15', period: 'mth', description: 'Billed annually.', features: ['200+ integrations', 'Advanced reporting and analytics', 'Up to 20 individual users', '40 GB individual data', 'Priority chat and email support'], action: { label: 'Get started', href: '#' } },
{ name: 'Enterprise plan', price: '$40', annualPrice: '$39', period: 'mth', description: 'Billed annually.', features: ['Advanced custom fields', 'Audit log and data history', 'Unlimited individual users', 'Unlimited individual data', 'Personalised and priority service'], action: { label: 'Get started', href: '#' } },
],
} = Astro.props
const itemLevel = headingLevel === 1 ? (2 as const) : (3 as const)
const icons = [Zap, Layers2, Layers3]
---
<Section spacing="none" container={false}>
<div class="group/pricing">
<div class="bg-primary-faded pt-section-lg pb-32 md:pb-48">
<div class="mx-auto flex max-w-7xl flex-col items-center gap-8 px-gutter">
{eyebrow && <Badge color="primary" size="large" rounded>{eyebrow}</Badge>}
<SectionHeader headingLevel={headingLevel} heading={plain(heading)} description={description ?? undefined} size="large" align="center" class="-mt-4" />
<Switch name="billing" value="annual" label={periods.annual} />
</div>
</div>
<div class="relative">
<div class="pointer-events-none absolute inset-0 bg-[repeating-linear-gradient(135deg,var(--border-neutral)_0_1px,transparent_1px_24px)] mask-b-from-50%" aria-hidden="true"></div>
<div class="relative mx-auto -mt-16 max-w-7xl px-gutter pb-section-lg md:-mt-24">
<div class="grid gap-4 md:grid-cols-2 md:gap-8 xl:grid-cols-3">
{items.map((plan, i) => {
const Icon = icons[i % icons.length]!
return (
<div class="flex flex-col overflow-hidden rounded-2xl bg-elevation-raised shadow-raised ring-1 ring-neutral">
<div class="flex flex-col items-center gap-4 px-6 pt-8 text-center md:px-8 md:pt-10">
<FeaturedIcon theme="outline" color="neutral" size="large"><Icon /></FeaturedIcon>
<Heading as={itemLevel === 2 ? 'h2' : 'h3'} size="h5" class="text-primary">{plan.name}</Heading>
<p class="flex items-baseline justify-center gap-1"><span class="text-5xl md:text-6xl font-semibold tracking-tight tabular-nums"><span class="group-has-[[value=annual]:checked]/pricing:hidden">{plan.price}</span><span class="hidden group-has-[[value=annual]:checked]/pricing:inline">{plan.annualPrice ?? plan.price}</span></span>{plan.period && <span class="text-neutral-faded">/{plan.period}</span>}</p>
<p class="text-neutral-faded">{plan.description}</p>
</div>
<div class="flex-1 px-6 py-8 md:px-8">
<ul class="flex list-none flex-col gap-4 p-0 text-neutral-faded">
{plan.features.map((f) => <li class="flex gap-3"><span class="flex size-6 shrink-0 items-center justify-center rounded-full bg-primary-faded text-primary"><Check class="size-4" aria-hidden="true" /></span><span>{f}</span></li>)}
</ul>
</div>
<div class="border-t border-neutral bg-neutral-faded p-6 md:px-8">
<Button href={plan.action.href} size="large" fullWidth>{plan.action.label}</Button>
</div>
</div>
)
})}
</div>
</div>
</div>
</div>
</Section>
Show codeHide code
---
/**
* Abstract angles: A heading and annual switch on a tinted band over three plan cards on a striped ground.
*
* @block pricing
* @order 17
*/
import { Check, Layers2, Layers3, Zap } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import Heading from '@/components/apogee/Heading/Heading.astro'
import Button from '@/components/apogee/Button/Button.astro'
import Badge from '@/components/apogee/Badge/Badge.astro'
import FeaturedIcon from '@/components/apogee/FeaturedIcon/FeaturedIcon.astro'
import Switch from '@/components/apogee/Switch/Switch.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { PricingContent } from '@/components/apogee/sections/_shared/pricing.ts'
/** @composable */
interface Props extends PricingContent {
/** 1 when the block opens a page; its items move one level down with it. */
headingLevel?: 1 | 2
}
// ponytail: one switch, so only `periods.annual` shows (as its label); `monthly` is unused here.
const {
headingLevel = 2,
eyebrow = 'Pricing plans',
heading = 'Plans for all sizes',
description = 'Simple, transparent pricing that grows with you. Try any plan free for 30 days.',
periods = { monthly: 'Monthly pricing', annual: 'Annual pricing (save 20%)' },
items = [
{ name: 'Basic plan', price: '$10', annualPrice: '$9', period: 'mth', description: 'Billed annually.', features: ['Access to all basic features', 'Basic reporting and analytics', 'Up to 10 individual users', '20 GB individual data', 'Basic chat and email support'], action: { label: 'Get started', href: '#' } },
{ name: 'Business plan', price: '$20', annualPrice: '$15', period: 'mth', description: 'Billed annually.', features: ['200+ integrations', 'Advanced reporting and analytics', 'Up to 20 individual users', '40 GB individual data', 'Priority chat and email support'], action: { label: 'Get started', href: '#' } },
{ name: 'Enterprise plan', price: '$40', annualPrice: '$39', period: 'mth', description: 'Billed annually.', features: ['Advanced custom fields', 'Audit log and data history', 'Unlimited individual users', 'Unlimited individual data', 'Personalised and priority service'], action: { label: 'Get started', href: '#' } },
],
} = Astro.props
const itemLevel = headingLevel === 1 ? (2 as const) : (3 as const)
const icons = [Zap, Layers2, Layers3]
---
<Section spacing="none" container={false}>
<div class="group/pricing">
<div class="bg-primary-faded pt-section-lg pb-32 md:pb-48">
<div class="mx-auto flex max-w-7xl flex-col items-center gap-8 px-gutter">
{eyebrow && <Badge color="primary" size="large" rounded>{eyebrow}</Badge>}
<SectionHeader headingLevel={headingLevel} heading={plain(heading)} description={description ?? undefined} size="large" align="center" class="-mt-4" />
<Switch name="billing" value="annual" label={periods.annual} />
</div>
</div>
<div class="relative">
<div class="pointer-events-none absolute inset-0 bg-[repeating-linear-gradient(135deg,var(--border-neutral)_0_1px,transparent_1px_24px)] mask-b-from-50%" aria-hidden="true"></div>
<div class="relative mx-auto -mt-16 max-w-7xl px-gutter pb-section-lg md:-mt-24">
<div class="grid gap-4 md:grid-cols-2 md:gap-8 xl:grid-cols-3">
{items.map((plan, i) => {
const Icon = icons[i % icons.length]!
return (
<div class="flex flex-col overflow-hidden rounded-2xl bg-elevation-raised shadow-raised ring-1 ring-neutral">
<div class="flex flex-col items-center gap-4 px-6 pt-8 text-center md:px-8 md:pt-10">
<FeaturedIcon theme="outline" color="neutral" size="large"><Icon /></FeaturedIcon>
<Heading as={itemLevel === 2 ? 'h2' : 'h3'} size="h5" class="text-primary">{plan.name}</Heading>
<p class="flex items-baseline justify-center gap-1"><span class="text-5xl md:text-6xl font-semibold tracking-tight tabular-nums"><span class="group-has-[[value=annual]:checked]/pricing:hidden">{plan.price}</span><span class="hidden group-has-[[value=annual]:checked]/pricing:inline">{plan.annualPrice ?? plan.price}</span></span>{plan.period && <span class="text-neutral-faded">/{plan.period}</span>}</p>
<p class="text-neutral-faded">{plan.description}</p>
</div>
<div class="flex-1 px-6 py-8 md:px-8">
<ul class="flex list-none flex-col gap-4 p-0 text-neutral-faded">
{plan.features.map((f) => <li class="flex gap-3"><span class="flex size-6 shrink-0 items-center justify-center rounded-full bg-primary-faded text-primary"><Check class="size-4" aria-hidden="true" /></span><span>{f}</span></li>)}
</ul>
</div>
<div class="border-t border-neutral bg-neutral-faded p-6 md:px-8">
<Button href={plan.action.href} size="large" fullWidth>{plan.action.label}</Button>
</div>
</div>
)
})}
</div>
</div>
</div>
</div>
</Section>Add
npx @ava-ui/apogee add pricing/abstract-angles
This copies the block to src/components/apogee/blocks/pricing/ with everything it uses: Badge, Button, FeaturedIcon, Heading, Section, SectionHeader, Switch. Every piece of copy is a prop, with the sample copy as its default. Pass yours, or null to hide a part; see copy is props.
Accessibility
- The heading is an
h2by default, so the block slots into a page under itsh1; item titles are one level down.
Related
PricingPlan tiers side by side, with an optional monthly / annual switch.
SegmentedControlA row of connected, mutually exclusive options backed by native radios — pick one from a small, always-visible set.
TableA styled, horizontally-scrollable table. Write plain thead/tbody markup — Table only styles it.