Marketing sectionsPricingCards
Searchastronomic.dev# PricingCards
To compare a few plans or packages side by side, each with a price, what it includes and one action.
Static: no JavaScript.
## Usage
```astro
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
```
## Examples
### Three plans
Each plan on a card, the cards in a row the same height, so every button sits on one line. As many columns as fit, each at least 16rem: one on a phone, three on a wide page. The highlighted plan has the accent edge, its badge and the primary button.
```astro
---
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
const plans = [
{
name: "Starter",
price: "$4,800",
period: "one time",
description: "A focused site for a new firm or a single service.",
features: ["Up to five pages", "One round of design changes", "Launch in four weeks"],
action: { label: "Choose Starter", href: "#starter" },
},
{
name: "Studio",
price: "$12,000",
period: "one time",
description: "Brand and site together, for firms ready to grow.",
features: ["Brand refresh and style guide", "Up to fifteen pages", "Two rounds of design changes", "Editor training for your team"],
action: { label: "Choose Studio", href: "#studio" },
highlighted: true,
badge: "Popular",
},
{
name: "Retainer",
price: "$1,500",
period: "per month",
description: "Ongoing design and small builds, month to month.",
features: ["Two days of work each month", "New pages and landing pages", "Reply within one working day"],
action: { label: "Choose Retainer", href: "#retainer" },
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<PricingCards heading="Ways to work with us" text="Fixed prices for a site, or a monthly retainer for ongoing work." plans={plans} />
</div>
```
### In a narrow column
Two plans in a 24rem column: one column of cards, a five-figure price on one line, and a long feature word stays inside its card (on a phone, where the card is narrower than the word, it breaks).
```astro
---
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
import { displayType } from "@astronomic-dev/ui/lib/display.ts";
const plans = [
{
name: "Studio",
price: "$12,000",
period: "one time",
description: "Brand and site together, for firms ready to grow.",
features: ["Brand refresh and style guide", "Up to fifteen pages", "Accessibilityreviewandeditortraining"],
action: { label: "Choose Studio", href: "#studio" },
highlighted: true,
badge: "Popular",
},
{
name: "Retainer",
price: "$1,500",
period: "per month",
features: ["Two days of work each month", "Reply within one working day"],
action: { label: "Choose Retainer", href: "#retainer" },
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<div data-narrow class="grid max-w-sm gap-blocks">
<h2 class={`m-0 text-title text-balance ${displayType}`}>In a narrow column</h2>
<PricingCards plans={plans} />
</div>
</div>
```
### Local prices
Prices in another currency and in words: "CHF 1’299.00" fits a phone card on one line, and "Starting at CHF 1’299.00" wraps between its words, never inside the number. Every price in a list takes the size at which the widest fits.
```astro
---
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
const local = [
{
name: "Studio",
price: "CHF 1’299.00",
period: "per month",
features: ["Brand refresh and style guide", "Up to fifteen pages"],
action: { label: "Choose Studio", href: "#studio" },
highlighted: true,
badge: "Popular",
},
{
name: "Starter",
price: "CHF 490.00",
period: "per month",
features: ["Up to five pages"],
action: { label: "Choose Starter", href: "#starter" },
},
];
const worded = [
{
name: "Custom",
price: "Starting at CHF 1’299.00",
period: "per project",
features: ["A site built around your brand", "Training for your editors"],
action: { label: "Ask about Custom", href: "#custom" },
},
];
---
<div class="mx-auto grid max-w-6xl gap-blocks px-6 py-16">
<div data-local><PricingCards heading="In Swiss francs" plans={local} /></div>
<div data-worded><PricingCards heading="In words" plans={worded} /></div>
</div>
```
### On sale
Two plans on sale beside one at its usual price: regularPrice strikes the usual price through after the sale price, and priceNote puts the saving beside it in a badge. A screen reader hears "Regular price $199", so the struck price is never read as the price. Set both only while the sale runs.
```astro
---
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
const plans = [
{
name: "Single theme",
price: "$79",
period: "per theme",
features: ["Any one theme", "Unlimited sites", "Lifetime updates"],
action: { label: "Choose a theme", href: "#single" },
},
{
name: "Themes Pass",
price: "$149",
regularPrice: "$199",
priceNote: "Save $50",
period: "Holiday sale",
features: ["Every theme", "Every theme we release later", "Unlimited sites", "Lifetime updates"],
action: { label: "Buy the Themes Pass", href: "#pass" },
highlighted: true,
badge: "Best value",
},
{
name: "All Access",
price: "$249",
regularPrice: "$299",
priceNote: "Save $50",
period: "Holiday sale",
features: ["Astronomic UI Pro", "Everything in the Themes Pass"],
action: { label: "Buy All Access", href: "#all" },
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<PricingCards heading="Pricing" text="One-time prices. Unlimited sites." plans={plans} />
</div>
```
## Props
### PricingCards
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | The section heading, in the title role in display type. Without it there is no section and no header: a plain <div> holds only the plans. |
| `emphasis` | `boolean` | `false` | Turn one *phrase* in the heading into <em>: exactly two asterisks around text with no space inside, as in "Built for *the long run*". Any other asterisks show as typed. Off by default, so the heading shows as typed. How the <em> looks is the theme's. |
| `mark` | `string` | None | A short mark after the heading, such as "(12)" or "©2026", in small muted type. It sits beside the heading, outside it, so the heading's name stays plain. Shown only with a heading. |
| `markLabel` | `string` | None | What the mark says to a screen reader, such as "12 projects": the mark is then hidden from screen readers and this is read in its place. Without it, the mark is read as written. |
| `text` | `string` | None | One or two sentences under the heading, in the lead role, muted. Shown only with a heading. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. Plan names sit one level under it. |
| `class` | `string` | None | More classes for the root (the <section>, or the <div> without a heading), merged with cn(), so yours win on conflicts. The root is a named size container (inline-size containment): in a shrink-to-fit parent (inline-flex, a float, fit-content) it collapses, so give it a width there. |
| `itemHeadingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | `"h3"` | The plan name element when there is no heading. With a heading, names sit one level under it. |
| `plans` | `PricingPlanItem[]` | None | Required. The plans, in order (every price takes the size at which the widest fits): { name, price, period?, regularPrice?, regularPriceLabel?, priceNote?, description?, features, action, highlighted?, badge? } (PricingPlanItem, exported from PricingCards.astro). price and period are strings, so any currency or wording works. action is { label, href?, variant?, disabled?, note? }: disabled renders a disabled button (no link) for a plan you cannot sell yet, and note is a short line under the button that says why, such as Coming soon. One plan at most may be highlighted (more throws): it gets an accent edge and, unless action.variant says otherwise, the primary button. badge is a short word on a plan, like Popular. Only these fields reach each plan, so a CMS entry's other fields never land on the page. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge. Shown only with a heading. |
Any other attribute goes on the <section>, or on the <div> without a heading.
## Accessibility
- With a heading, renders a <section> named by it, so it is a region landmark. The heading id is unique on the page.
- Without a heading, renders a plain <div>. Put your own heading above it.
- Each plan name sits one level under the section heading (h2 gives h3). With no heading, it is an h3 unless you set itemHeadingTag.
- Each plan's features are a list (<ul role="list">), so a screen reader says how many there are.
- Give each action a label that names the plan, like "Choose Studio", so the links make sense out of context.
- The plans sit in one list (<ul role="list">), so a screen reader says how many there are. With no plans the list is still there, empty: leave the section out when there are none.
- The highlighted plan is marked by its badge text, not by color alone: give it a badge, like "Popular".
PricingCards
ProTo compare a few plans or packages side by side, each with a price, what it includes and one action.
- File
- PricingCards.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 4
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Three plans
Each plan on a card, the cards in a row the same height, so every button sits on one line. As many columns as fit, each at least 16rem: one on a phone, three on a wide page. The highlighted plan has the accent edge, its badge and the primary button.
This preview did not load.
examples/pricingcards/main.astro
---
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
const plans = [
{
name: "Starter",
price: "$4,800",
period: "one time",
description: "A focused site for a new firm or a single service.",
features: ["Up to five pages", "One round of design changes", "Launch in four weeks"],
action: { label: "Choose Starter", href: "#starter" },
},
{
name: "Studio",
price: "$12,000",
period: "one time",
description: "Brand and site together, for firms ready to grow.",
features: ["Brand refresh and style guide", "Up to fifteen pages", "Two rounds of design changes", "Editor training for your team"],
action: { label: "Choose Studio", href: "#studio" },
highlighted: true,
badge: "Popular",
},
{
name: "Retainer",
price: "$1,500",
period: "per month",
description: "Ongoing design and small builds, month to month.",
features: ["Two days of work each month", "New pages and landing pages", "Reply within one working day"],
action: { label: "Choose Retainer", href: "#retainer" },
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<PricingCards heading="Ways to work with us" text="Fixed prices for a site, or a monthly retainer for ongoing work." plans={plans} />
</div>In a narrow column
Two plans in a 24rem column: one column of cards, a five-figure price on one line, and a long feature word stays inside its card (on a phone, where the card is narrower than the word, it breaks).
This preview did not load.
examples/pricingcards/narrow.astro
---
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
import { displayType } from "@astronomic-dev/ui/lib/display.ts";
const plans = [
{
name: "Studio",
price: "$12,000",
period: "one time",
description: "Brand and site together, for firms ready to grow.",
features: ["Brand refresh and style guide", "Up to fifteen pages", "Accessibilityreviewandeditortraining"],
action: { label: "Choose Studio", href: "#studio" },
highlighted: true,
badge: "Popular",
},
{
name: "Retainer",
price: "$1,500",
period: "per month",
features: ["Two days of work each month", "Reply within one working day"],
action: { label: "Choose Retainer", href: "#retainer" },
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<div data-narrow class="grid max-w-sm gap-blocks">
<h2 class={`m-0 text-title text-balance ${displayType}`}>In a narrow column</h2>
<PricingCards plans={plans} />
</div>
</div>Local prices
Prices in another currency and in words: "CHF 1’299.00" fits a phone card on one line, and "Starting at CHF 1’299.00" wraps between its words, never inside the number. Every price in a list takes the size at which the widest fits.
This preview did not load.
examples/pricingcards/local.astro
---
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
const local = [
{
name: "Studio",
price: "CHF 1’299.00",
period: "per month",
features: ["Brand refresh and style guide", "Up to fifteen pages"],
action: { label: "Choose Studio", href: "#studio" },
highlighted: true,
badge: "Popular",
},
{
name: "Starter",
price: "CHF 490.00",
period: "per month",
features: ["Up to five pages"],
action: { label: "Choose Starter", href: "#starter" },
},
];
const worded = [
{
name: "Custom",
price: "Starting at CHF 1’299.00",
period: "per project",
features: ["A site built around your brand", "Training for your editors"],
action: { label: "Ask about Custom", href: "#custom" },
},
];
---
<div class="mx-auto grid max-w-6xl gap-blocks px-6 py-16">
<div data-local><PricingCards heading="In Swiss francs" plans={local} /></div>
<div data-worded><PricingCards heading="In words" plans={worded} /></div>
</div>On sale
Two plans on sale beside one at its usual price: regularPrice strikes the usual price through after the sale price, and priceNote puts the saving beside it in a badge. A screen reader hears "Regular price $199", so the struck price is never read as the price. Set both only while the sale runs.
This preview did not load.
examples/pricingcards/sale.astro
---
import PricingCards from "@astronomic/ui-pro/components/PricingCards.astro";
const plans = [
{
name: "Single theme",
price: "$79",
period: "per theme",
features: ["Any one theme", "Unlimited sites", "Lifetime updates"],
action: { label: "Choose a theme", href: "#single" },
},
{
name: "Themes Pass",
price: "$149",
regularPrice: "$199",
priceNote: "Save $50",
period: "Holiday sale",
features: ["Every theme", "Every theme we release later", "Unlimited sites", "Lifetime updates"],
action: { label: "Buy the Themes Pass", href: "#pass" },
highlighted: true,
badge: "Best value",
},
{
name: "All Access",
price: "$249",
regularPrice: "$299",
priceNote: "Save $50",
period: "Holiday sale",
features: ["Astronomic UI Pro", "Everything in the Themes Pass"],
action: { label: "Buy All Access", href: "#all" },
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<PricingCards heading="Pricing" text="One-time prices. Unlimited sites." plans={plans} />
</div>