Marketing sectionsPostFeatured
Searchastronomic.dev# PostFeatured
To lead with one post you pick, large, then the latest posts as cards.
Static: no JavaScript.
## Usage
```astro
import PostFeatured from "@astronomic/ui-pro/components/PostFeatured.astro";
```
## Examples
### A featured post
The post you pick, as one large card across the row, then the three latest as cards under it, then the link to all posts. From a 48rem posts container the featured card puts its picture in a wider start column beside the text, its title in the subhead role (one step under the section heading); below that it stacks like the others. The other cards take as many columns as fit, each at least 18rem.
```astro
---
import PostFeatured from "@astronomic/ui-pro/components/PostFeatured.astro";
// Your own pictures, and the authors' photos.
import ada from "../../photos/portrait-curly-hair.webp";
import jonas from "../../photos/portrait-grey-hair.webp";
import lena from "../../photos/portrait-glasses.webp";
import stairway from "../../photos/white-stairway.webp";
import desk from "../../photos/studio-desk.webp";
import folders from "../../photos/folder-stack.webp";
import sketch from "../../photos/sketching-wireframes.webp";
// The post you lead with: you pick it, and it is not in items.
const featured = {
href: "#rebuild",
title: "How we rebuilt our own site in three weeks",
date: "2026-10-14",
readingTime: "9 min read",
excerpt: "The plan, the sketches, the first build and what we cut on the way. Everything we tell clients to do, done on ourselves, with the dates.",
image: { src: stairway },
topic: { label: "Studio", href: "#topic-studio" },
author: { name: "Ada Brook", image: { src: ada } },
};
// The latest posts after it, newest first. Dates are "YYYY-MM-DD" strings.
const posts = [
{
href: "#launch-checklist",
title: "A launch checklist for a small studio site",
date: "2026-10-07",
excerpt: "The twelve checks we run the week before a site goes live.",
image: { src: desk },
topic: { label: "Process", href: "#topic-process" },
author: { name: "Jonas Weber", image: { src: jonas } },
},
{
href: "#sketch-first",
title: "Sketch the page before the first pixel",
date: "2026-10-02",
excerpt: "Why every Astronomic project starts with a pencil.",
image: { src: sketch },
topic: { label: "Design", href: "#topic-design" },
author: { name: "Lena Ruiz", image: { src: lena } },
},
{
href: "#content-move",
title: "Moving an old site's content without losing a page",
date: "2026-09-18",
excerpt: "A spreadsheet, a redirect map and one rule for every old address.",
image: { src: folders },
topic: { label: "Content", href: "#topic-content" },
author: { name: "Sam Okafor" },
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<PostFeatured heading="Notes from the studio" text="How we plan, design and build sites, written up as we go." featured={featured} items={posts} viewAll={{ label: "All posts", href: "#blog" }} />
</div>
```
## Props
### PostFeatured
| 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 posts. |
| `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. Each post title sits one level under it. |
| `viewAll` | `PostsLink` | None | A link after the list: { label, href } (PostsLink), such as { label: "All posts", href: "/blog" }. Name the page, not "More". |
| `empty` | `string` | None | Text shown in place of the list when there are no posts, such as "No posts yet.". Without it, no posts render no list and no text. |
| `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 title element when there is no heading. With a heading, titles sit one level under it. |
| `items` | `PostItem[]` | None | Required. The posts, newest first (the order you pass): { href, title, date?, dateLabel?, excerpt?, image?, topic?, author?, readingTime? } (PostItem). date (optional) is "YYYY-MM-DD", such as "2026-10-14" (the canonical form), or a Date read in UTC, as Astro content collections give. new Date(2026, 9, 14) is local midnight, which shows the day before east of UTC: pass the string instead. A bad value throws at build time with the value in the message, so no page says "Invalid Date". dateLabel is your own text in place of the printed date ("Updated 3 days ago"); the datetime stays the date, and it shows only with a date. image is { src, width?, height?, ratio?, focalPoint?, loading? }, with no alt: the part writes alt="", since the title says what the post is. topic is { label, href? }; author is { name, image? }; readingTime is your own text, such as "5 min read". Only these fields reach each post, so a CMS entry's other fields never reach the page. With none, the empty text shows, or nothing. These are the posts after the featured one: leave the featured post out of them. |
| `locale` | `string` | `"en"` | The dates' language, such as "de" (14.10.2026); the default prints "Oct 14, 2026". Passed to every post (formatDate in lib/date.ts). The dates are read in UTC, so the day never moves with the time zone. |
| `featured` | `PostItem` | None | Required. The post you lead with, shown large first: { href, title, date?, dateLabel?, excerpt?, image?, topic?, author?, readingTime? } (PostItem). date (optional) is "YYYY-MM-DD", such as "2026-10-14" (the canonical form), or a Date read in UTC, as Astro content collections give. new Date(2026, 9, 14) is local midnight, which shows the day before east of UTC: pass the string instead. A bad value throws at build time with the value in the message, so no page says "Invalid Date". dateLabel is your own text in place of the printed date ("Updated 3 days ago"); the datetime stays the date, and it shows only with a date. image is { src, width?, height?, ratio?, focalPoint?, loading? }, with no alt: the part writes alt="", since the title says what the post is. topic is { label, href? }; author is { name, image? }; readingTime is your own text, such as "5 min read". You pick it: it is never taken from items. Without a picture it is a large card of text. |
| `imageComponent` | `ImageComponent` | None | Your image component, for every picture: Astro's <Image>, or a small wrapper for your CMS. The recipe passes a sizes hint for each card (the featured picture (min-width: 72rem) 40rem, (min-width: 52rem) 55vw, 100vw; the smaller cards PostGrid's hint for their number, gridImageSizes in lib/image.ts). See PostGrid's own-images example and "Your own images" in the kit README. |
| 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.
- The posts are a list (<ul role="list">), so a screen reader says how many there are. Each post is an <article> in its <li>.
- Each title sits one level under the section heading (h2 gives h3), so a reader can jump from post to post. With no heading, it is an h3 unless you set itemHeadingTag.
- The title is the only link to the post, so a screen reader's list of links reads each title once, with no "Read more". On a card the whole card is clickable, and the title names it: the focus ring goes round the card.
- The topic is a link of its own to the topic's page. On a card it leads the meta line above the title, so Tab reaches it before the title; in a row it sits under the excerpt, so Tab reaches it after the title. Either way the Tab order is the reading order.
- The date is a <time> with a machine date (datetime="2026-10-14"), whatever the text says.
- With no posts the list is left out: the empty text shows in its place when you give one. With no posts and no empty text, leave the section out, or it is a heading over nothing.
- The view-all link comes after the posts. Name the page it opens ("All posts"), not "More". On touch screens it is a box of 44px at least.
- The featured post is the first item in the same list, with a title at the same level as the others: it is larger, not a heading above them.
PostFeatured
ProTo lead with one post you pick, large, then the latest posts as cards.
- File
- PostFeatured.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
A featured post
The post you pick, as one large card across the row, then the three latest as cards under it, then the link to all posts. From a 48rem posts container the featured card puts its picture in a wider start column beside the text, its title in the subhead role (one step under the section heading); below that it stacks like the others. The other cards take as many columns as fit, each at least 18rem.
This preview did not load.
main.astro
examples/postfeatured/main.astro
---
import PostFeatured from "@astronomic/ui-pro/components/PostFeatured.astro";
// Your own pictures, and the authors' photos.
import ada from "../../photos/portrait-curly-hair.webp";
import jonas from "../../photos/portrait-grey-hair.webp";
import lena from "../../photos/portrait-glasses.webp";
import stairway from "../../photos/white-stairway.webp";
import desk from "../../photos/studio-desk.webp";
import folders from "../../photos/folder-stack.webp";
import sketch from "../../photos/sketching-wireframes.webp";
// The post you lead with: you pick it, and it is not in items.
const featured = {
href: "#rebuild",
title: "How we rebuilt our own site in three weeks",
date: "2026-10-14",
readingTime: "9 min read",
excerpt: "The plan, the sketches, the first build and what we cut on the way. Everything we tell clients to do, done on ourselves, with the dates.",
image: { src: stairway },
topic: { label: "Studio", href: "#topic-studio" },
author: { name: "Ada Brook", image: { src: ada } },
};
// The latest posts after it, newest first. Dates are "YYYY-MM-DD" strings.
const posts = [
{
href: "#launch-checklist",
title: "A launch checklist for a small studio site",
date: "2026-10-07",
excerpt: "The twelve checks we run the week before a site goes live.",
image: { src: desk },
topic: { label: "Process", href: "#topic-process" },
author: { name: "Jonas Weber", image: { src: jonas } },
},
{
href: "#sketch-first",
title: "Sketch the page before the first pixel",
date: "2026-10-02",
excerpt: "Why every Astronomic project starts with a pencil.",
image: { src: sketch },
topic: { label: "Design", href: "#topic-design" },
author: { name: "Lena Ruiz", image: { src: lena } },
},
{
href: "#content-move",
title: "Moving an old site's content without losing a page",
date: "2026-09-18",
excerpt: "A spreadsheet, a redirect map and one rule for every old address.",
image: { src: folders },
topic: { label: "Content", href: "#topic-content" },
author: { name: "Sam Okafor" },
},
];
---
<div class="mx-auto max-w-6xl px-6 py-16">
<PostFeatured heading="Notes from the studio" text="How we plan, design and build sites, written up as we go." featured={featured} items={posts} viewAll={{ label: "All posts", href: "#blog" }} />
</div>Minimal · Light