4 min read
Letting editors change pages without breaking them
How we set up the editing side of a site, so a new page or a new case study never needs a developer.
Data displayPostRow
Searchastronomic.dev# PostRow
For one post as a row: its date, title, excerpt and topic. PostList uses it for you.
Static: no JavaScript.
## Usage
```astro
import PostRow from "@astronomic-dev/ui/components/PostRow.astro";
```
## Examples
### In a Posts list
Two posts, each a PostRow in an <li>, on hairlines; the last row adds border-b-ui to close the list. From a 42rem posts container the date takes its own start column beside the title, the excerpt and the topic; below that it sits above the title. The second post has no excerpt, and dateLabel prints "Updated last week" in place of the date, while the <time> keeps the real date. PostList builds its rows from it, so you only need it for your own layout.
```astro
---
import PostRow from "@astronomic-dev/ui/components/PostRow.astro";
import Posts from "@astronomic-dev/ui/components/Posts.astro";
import { childHeadingTag } from "@astronomic-dev/ui/lib/heading.ts";
const heading = "Recent writing";
// One level under the section heading: h2 gives h3.
const tag = childHeadingTag({ heading });
---
<div class="mx-auto max-w-4xl">
<Posts heading={heading} listClass="gap-0">
<li class="grid min-w-0">
<PostRow
href="#editors"
title="Letting editors change pages without breaking them"
date="2026-10-09"
readingTime="4 min read"
excerpt="How we set up the editing side of a site, so a new page or a new case study never needs a developer."
topic={{ label: "Editing", href: "#topic-editing" }}
headingTag={tag}
/>
</li>
<li class="grid min-w-0">
<PostRow href="#pricing-page" title="What we changed on our own pricing page" date="2026-09-24" dateLabel="Updated last week" topic={{ label: "Studio" }} headingTag={tag} class="border-b-ui" />
</li>
</Posts>
</div>
```
## Props
### PostRow
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `href` | `string` | None | Required. The post's URL. The title is the only link to it. |
| `title` | `string` | None | Required. The post's title: the item heading and the link. |
| `date` | `DateInput` | None | Optional. The post's date: "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". Written as <time datetime>. Without it there is no <time>; the reading time stands alone, or the meta line is left out. |
| `dateLabel` | `string` | None | Your own text in place of the printed date, such as "Updated 3 days ago". The datetime stays the date. Shown only with a date. |
| `excerpt` | `string` | None | A line or two about the post, muted, at a reading width. |
| `topic` | `PostTopic` | None | { label, href? } (PostTopic, from PostCard.astro): with href a link to the topic's page; without, plain text. Under the excerpt. |
| `readingTime` | `string` | None | Your own text, such as "5 min read", after the date, or alone when there is none. |
| `locale` | `string` | `"en"` | The date's language, such as "de" (formatDate in lib/date.ts). The recipes pass theirs. |
| `headingTag` | `"h2" \| "h3" \| "h4" \| "h5"` | None | Required. The title element. Pass childHeadingTag({ heading, headingTag }) from lib/heading.ts, one level under the section heading. |
| `class` | `string` | None | More classes for the root <article>, merged with cn(), so yours win on conflicts, such as border-b-ui on the last row, or a tighter padding (PostCompact sets py-item). |
Any other attribute goes on the root <article>.
## Accessibility
- Renders one <article>: put it in an <li> in a Posts list.
- The title is a heading one level under the section heading: pass childHeadingTag, so a reader can jump from post to post.
- The title is the only link to the post, so a list of links reads each title once. There is no "Read more".
- The topic is a separate link, reached with Tab after the title.
- The date is a <time> with a machine date (datetime="2026-10-14"), whatever the text says. It comes first in the source and on the screen.
For one post as a row: its date, title, excerpt and topic. PostList uses it for you.
Drag the orange handle to set the width. Frames get real breakpoints.
Two posts, each a PostRow in an <li>, on hairlines; the last row adds border-b-ui to close the list. From a 42rem posts container the date takes its own start column beside the title, the excerpt and the topic; below that it sits above the title. The second post has no excerpt, and dateLabel prints "Updated last week" in place of the date, while the <time> keeps the real date. PostList builds its rows from it, so you only need it for your own layout.
4 min read
How we set up the editing side of a site, so a new page or a new case study never needs a developer.
examples/postrow/main.astro
---
import PostRow from "@astronomic-dev/ui/components/PostRow.astro";
import Posts from "@astronomic-dev/ui/components/Posts.astro";
import { childHeadingTag } from "@astronomic-dev/ui/lib/heading.ts";
const heading = "Recent writing";
// One level under the section heading: h2 gives h3.
const tag = childHeadingTag({ heading });
---
<div class="mx-auto max-w-4xl">
<Posts heading={heading} listClass="gap-0">
<li class="grid min-w-0">
<PostRow
href="#editors"
title="Letting editors change pages without breaking them"
date="2026-10-09"
readingTime="4 min read"
excerpt="How we set up the editing side of a site, so a new page or a new case study never needs a developer."
topic={{ label: "Editing", href: "#topic-editing" }}
headingTag={tag}
/>
</li>
<li class="grid min-w-0">
<PostRow href="#pricing-page" title="What we changed on our own pricing page" date="2026-09-24" dateLabel="Updated last week" topic={{ label: "Studio" }} headingTag={tag} class="border-b-ui" />
</li>
</Posts>
</div>