Marketing sectionsPricing
Searchastronomic.dev# Pricing
To build your own pricing layout: a section heading and one or more plans, each with a price, what it includes and one action. For a ready layout, use PricingCards or PricingSingle.
Static: no JavaScript.
## Usage
```astro
import Pricing from "@astronomic/ui-pro/components/Pricing.astro";
```
## Examples
### Slots
The section is a shell: the eyebrow, the heading and the text always show in that order, then the list of plans in the default slot, one PricingPlan in an <li> each. The shell sets the type and the gaps; the recipes lay out the plans. PricingCards and PricingSingle are recipes built on it. childHeadingTag() in lib/heading.ts gives the plan names' level.
```astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import { childHeadingTag } from "@astronomic-dev/ui/lib/heading.ts";
import Pricing from "@astronomic/ui-pro/components/Pricing.astro";
import PricingPlan from "@astronomic/ui-pro/components/PricingPlan.astro";
const heading = "Ways to work with us";
// One level under the section heading: h2 gives h3.
const tag = childHeadingTag({ heading });
---
<div class="mx-auto max-w-6xl px-6 py-16">
<Pricing heading={heading} text="Fixed prices for a site, or a monthly retainer for ongoing work." listClass="gap-cards @3xl/pricing:grid-cols-2">
<Badge slot="eyebrow">Pricing</Badge>
<li class="grid min-w-0">
<PricingPlan
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" }}
headingTag={tag}
/>
</li>
<li class="grid min-w-0">
<PricingPlan
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" }}
headingTag={tag}
/>
</li>
</Pricing>
</div>
```
## Props
### Pricing
| 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. |
| `align` | `"start" \| "center"` | `"start"` | For recipes. The alignment of the header (SectionHead) only: the recipe lays out the plans. |
| `list` | `boolean` | `true` | For recipes. The plans sit in one <ul role="list">; false gives a plain <div>, for one plan (a one-item list is noise for a screen reader). |
| `contentClass` | `string` | None | For recipes. Classes for the row that holds the header and the plans. |
| `headerClass` | `string` | None | For recipes. Classes for the header (the eyebrow, the heading and the text). |
| `listClass` | `string` | None | For recipes. Classes for the box that holds the plans, such as its columns and its gap (the shell sets no gap). It sits inside the pricing container, so its classes can query it (@3xl/pricing:...). |
| `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. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge. Shown only with a heading. |
| `default` | The plans: one <li> each, holding a PricingPlan. The <ul> becomes a plain box only through a recipe's list={false}. |
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".
Pricing
ProTo build your own pricing layout: a section heading and one or more plans, each with a price, what it includes and one action. For a ready layout, use PricingCards or PricingSingle.
- File
- Pricing.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Slots
The section is a shell: the eyebrow, the heading and the text always show in that order, then the list of plans in the default slot, one PricingPlan in an <li> each. The shell sets the type and the gaps; the recipes lay out the plans. PricingCards and PricingSingle are recipes built on it. childHeadingTag() in lib/heading.ts gives the plan names' level.
This preview did not load.
main.astro
examples/pricing/main.astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import { childHeadingTag } from "@astronomic-dev/ui/lib/heading.ts";
import Pricing from "@astronomic/ui-pro/components/Pricing.astro";
import PricingPlan from "@astronomic/ui-pro/components/PricingPlan.astro";
const heading = "Ways to work with us";
// One level under the section heading: h2 gives h3.
const tag = childHeadingTag({ heading });
---
<div class="mx-auto max-w-6xl px-6 py-16">
<Pricing heading={heading} text="Fixed prices for a site, or a monthly retainer for ongoing work." listClass="gap-cards @3xl/pricing:grid-cols-2">
<Badge slot="eyebrow">Pricing</Badge>
<li class="grid min-w-0">
<PricingPlan
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" }}
headingTag={tag}
/>
</li>
<li class="grid min-w-0">
<PricingPlan
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" }}
headingTag={tag}
/>
</li>
</Pricing>
</div>Minimal · Light