Marketing sectionsFeatures
Searchastronomic.dev# Features
To build your own features layout: a section heading and a list of features, each with a title and a short text. For a ready layout, use FeatureGridCards, FeatureGridIcons, FeatureGridSplit or FeatureRows.
Static: no JavaScript.
## Usage
```astro
import Features from "@astronomic-dev/ui/components/Features.astro";
```
## Examples
### Slots
The section is a shell: the eyebrow, the heading and the text always show in that order, then the list of FeatureItems in the default slot. The shell sets the type, the gaps and the reading width; the recipes lay out the header and the list. FeatureGridCards is a recipe built on it. childHeadingTag() in lib/heading.ts gives the items' title level.
```astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import FeatureItem from "@astronomic-dev/ui/components/FeatureItem.astro";
import Features from "@astronomic-dev/ui/components/Features.astro";
import { childHeadingTag } from "@astronomic-dev/ui/lib/heading.ts";
const heading = "What we do";
const features = [
{ title: "Strategy", text: "We learn your clients, your offer, and what the site must do." },
{ title: "Design", text: "A clear look that fits your firm, tested on real content." },
{ title: "Build", text: "Fast pages, easy editing, and a clean handover." },
];
// One level under the section heading: h2 gives h3.
const tag = childHeadingTag({ heading });
---
<div class="mx-auto max-w-6xl px-6 py-16">
<Features heading={heading} text="One small team, from the first call to the launch and after." listClass="@3xl/features:grid-cols-3">
<Badge slot="eyebrow">Services</Badge>
{features.map((f) => <FeatureItem title={f.title} text={f.text} headingTag={tag} />)}
</Features>
</div>
```
### Without a heading
Your own heading above the list. The list's columns still follow the room it has: three in a wide column, one in a 24rem column on the same page.
```astro
---
import FeatureItem from "@astronomic-dev/ui/components/FeatureItem.astro";
import Features from "@astronomic-dev/ui/components/Features.astro";
const features = [
{ title: "Strategy", text: "We learn your clients, your offer, and what the site must do." },
{ title: "Design", text: "A clear look that fits your firm, tested on real content." },
{ title: "Build", text: "Fast pages, easy editing, and a clean handover." },
];
---
<div class="mx-auto grid max-w-6xl gap-blocks px-6 py-16">
<div data-wide class="grid gap-blocks">
<h2 class="m-0 text-title">What we do</h2>
<Features listClass="@3xl/features:grid-cols-3">
{features.map((f) => <FeatureItem title={f.title} text={f.text} headingTag="h3" />)}
</Features>
</div>
<div data-narrow class="grid max-w-sm gap-blocks">
<h2 class="m-0 text-title">In a narrow column</h2>
<Features listClass="@3xl/features:grid-cols-3">
{features.map((f) => <FeatureItem title={f.title} text={f.text} headingTag="h3" />)}
</Features>
</div>
</div>
```
## Props
### Features
| 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 list. |
| `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. Item titles sit one level under it. |
| `contentClass` | `string` | None | For recipes. Classes for the row that holds the header and the list. |
| `headerClass` | `string` | None | For recipes. Classes for the header (the eyebrow, the heading and the text), at the reading width. |
| `listClass` | `string` | None | For recipes. Classes for the list of items, such as its columns. The list sits inside the features container, so its classes can query it (@3xl/features:...), with or without a heading. |
| `class` | `string` | None | More classes for the root (the <section>, or the <div> around the list without a heading), merged with cn(), so yours win on conflicts. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge. Shown only with a heading. |
| `default` | The items: one FeatureItem (an <li>) each. |
Any other attribute goes on the <section>, or on the <div> around the list 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 only the list in a plain <div>, with no section and no header (text and the eyebrow are left out). Put your own heading above it.
- The items sit in one list (<ul role="list">), so a screen reader says how many there are.
- Each item title sits one level under the section heading (h2 gives h3). With no heading, it is an h3 unless you set itemHeadingTag.
Features
FreeTo build your own features layout: a section heading and a list of features, each with a title and a short text. For a ready layout, use FeatureGridCards, FeatureGridIcons, FeatureGridSplit or FeatureRows.
- File
- Features.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 2
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 FeatureItems in the default slot. The shell sets the type, the gaps and the reading width; the recipes lay out the header and the list. FeatureGridCards is a recipe built on it. childHeadingTag() in lib/heading.ts gives the items' title level.
This preview did not load.
examples/features/main.astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import FeatureItem from "@astronomic-dev/ui/components/FeatureItem.astro";
import Features from "@astronomic-dev/ui/components/Features.astro";
import { childHeadingTag } from "@astronomic-dev/ui/lib/heading.ts";
const heading = "What we do";
const features = [
{ title: "Strategy", text: "We learn your clients, your offer, and what the site must do." },
{ title: "Design", text: "A clear look that fits your firm, tested on real content." },
{ title: "Build", text: "Fast pages, easy editing, and a clean handover." },
];
// One level under the section heading: h2 gives h3.
const tag = childHeadingTag({ heading });
---
<div class="mx-auto max-w-6xl px-6 py-16">
<Features heading={heading} text="One small team, from the first call to the launch and after." listClass="@3xl/features:grid-cols-3">
<Badge slot="eyebrow">Services</Badge>
{features.map((f) => <FeatureItem title={f.title} text={f.text} headingTag={tag} />)}
</Features>
</div>Without a heading
Your own heading above the list. The list's columns still follow the room it has: three in a wide column, one in a 24rem column on the same page.
This preview did not load.
examples/features/headingless.astro
---
import FeatureItem from "@astronomic-dev/ui/components/FeatureItem.astro";
import Features from "@astronomic-dev/ui/components/Features.astro";
const features = [
{ title: "Strategy", text: "We learn your clients, your offer, and what the site must do." },
{ title: "Design", text: "A clear look that fits your firm, tested on real content." },
{ title: "Build", text: "Fast pages, easy editing, and a clean handover." },
];
---
<div class="mx-auto grid max-w-6xl gap-blocks px-6 py-16">
<div data-wide class="grid gap-blocks">
<h2 class="m-0 text-title">What we do</h2>
<Features listClass="@3xl/features:grid-cols-3">
{features.map((f) => <FeatureItem title={f.title} text={f.text} headingTag="h3" />)}
</Features>
</div>
<div data-narrow class="grid max-w-sm gap-blocks">
<h2 class="m-0 text-title">In a narrow column</h2>
<Features listClass="@3xl/features:grid-cols-3">
{features.map((f) => <FeatureItem title={f.title} text={f.text} headingTag="h3" />)}
</Features>
</div>
</div>