Marketing sectionsFeatureGridCards
Searchastronomic.dev# FeatureGridCards
To show a few strengths or services side by side, each with a title and a short text.
Static: no JavaScript.
## Usage
```astro
import FeatureGridCards from "@astronomic-dev/ui/components/FeatureGridCards.astro";
```
## Examples
### Services
Each feature is a Card. As many columns as fit, each at least 15rem: one on a phone, up to four on a wide page. Set cols (2, 3 or 4) to cap the columns.
```astro
---
import FeatureGridCards from "@astronomic-dev/ui/components/FeatureGridCards.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." },
{ title: "Support", text: "Small changes every month, and help when your team needs it." },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<FeatureGridCards heading="What we do" text="One small team, from the first call to the launch and after." items={features} />
</div>
```
### What we do
Four items, cols={2}: two and two from a tablet up, never four in a row; one column on a phone.
```astro
---
import FeatureGridCards from "@astronomic-dev/ui/components/FeatureGridCards.astro";
// Four items with cols={2}: two and two from a tablet up, never four in a row; one column on a phone.
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." },
{ title: "Support", text: "Small changes every month, and help when your team needs it." },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<FeatureGridCards heading="What we do" text="Four services, two by two." items={features} cols={2} />
</div>
```
## Props
### FeatureGridCards
| 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. |
| `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. |
| `itemHeadingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | `"h3"` | The item title element when there is no heading. |
| `cols` | `2 \| 3 \| 4` | None | The most columns, so a count such as six splits evenly (3 + 3). One column, two from a 36rem section, then cols from 56rem (4: from 64rem). Unset: as many as fit, each at least 15rem. |
| `items` | `{ title, text, image? }[]` | None | Required. The features (FeatureCardItem, exported from FeatureGridCards.astro). image (a MediaImage) goes at the top of its card. |
| 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> 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.
FeatureGridCards
FreeTo show a few strengths or services side by side, each with a title and a short text.
- File
- FeatureGridCards.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
Services
Each feature is a Card. As many columns as fit, each at least 15rem: one on a phone, up to four on a wide page. Set cols (2, 3 or 4) to cap the columns.
This preview did not load.
main.astro
examples/featuregridcards/main.astro
---
import FeatureGridCards from "@astronomic-dev/ui/components/FeatureGridCards.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." },
{ title: "Support", text: "Small changes every month, and help when your team needs it." },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<FeatureGridCards heading="What we do" text="One small team, from the first call to the launch and after." items={features} />
</div>What we do
Four items, cols={2}: two and two from a tablet up, never four in a row; one column on a phone.
This preview did not load.
columns.astro
examples/featuregridcards/columns.astro
---
import FeatureGridCards from "@astronomic-dev/ui/components/FeatureGridCards.astro";
// Four items with cols={2}: two and two from a tablet up, never four in a row; one column on a phone.
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." },
{ title: "Support", text: "Small changes every month, and help when your team needs it." },
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<FeatureGridCards heading="What we do" text="Four services, two by two." items={features} cols={2} />
</div>Minimal · Light