Data displayByline
Searchastronomic.dev# Byline
Under a post's title: who wrote it, with their photo, the date and the reading time.
Static: no JavaScript.
## Usage
```astro
import Byline from "@astronomic-dev/ui/components/Byline.astro";
```
## Examples
### One writer
The photo, the name (a link to the writer's page), then the date, the reading time and the series, small and muted. Put it in ArticleHeaderPlain's byline slot, or under ArticleHeaderCover.
```astro
---
import Byline from "@astronomic-dev/ui/components/Byline.astro";
// Your own photo.
import ada from "../../photos/portrait-curly-hair.webp";
---
<div class="mx-auto max-w-2xl">
<Byline
authors={[{ name: "Ada Brook", href: "#ada", image: { src: ada } }]}
date="2026-10-14"
readingTime="8 min read"
series={{ label: "Launch notes, part 1", href: "#series-launch" }}
/>
</div>
```
### Two writers
The names join in the locale's list style ("Ada Brook and Lena Ruiz"), each its own link; the photos overlap by a quarter. With more than three writers, three marks show and a round +N mark after them.
```astro
---
import Byline from "@astronomic-dev/ui/components/Byline.astro";
// Your own photos.
import ada from "../../photos/portrait-curly-hair.webp";
import lena from "../../photos/portrait-glasses.webp";
---
<div class="mx-auto max-w-2xl">
<Byline
authors={[
{ name: "Ada Brook", href: "#ada", image: { src: ada } },
{ name: "Lena Ruiz", href: "#lena", image: { src: lena } },
]}
date="2026-10-07"
readingTime="11 min read"
/>
</div>
```
### No photo
A writer without a photo gets their initials in its place (the same rule as Avatar), so the row keeps its shape.
```astro
---
import Byline from "@astronomic-dev/ui/components/Byline.astro";
---
<div class="mx-auto max-w-2xl">
<Byline authors={[{ name: "Jonas Weber", href: "#jonas" }]} date="2026-09-30" readingTime="4 min read" />
</div>
```
### Five writers
Five writers with long names: three photos, then a round +2 mark; every name is its own link, and the names wrap inside the box.
```astro
---
import Share from "@lucide/astro/icons/share";
import Button from "@astronomic-dev/ui/components/Button.astro";
import Byline from "@astronomic-dev/ui/components/Byline.astro";
import Icon from "@astronomic-dev/ui/components/Icon.astro";
// Your own photos.
import ada from "../../photos/portrait-curly-hair.webp";
import jonas from "../../photos/portrait-grey-hair.webp";
import lena from "../../photos/portrait-glasses.webp";
---
<!-- Five writers with long names: three photos, then +2; every name stays a link of its own and wraps inside the box. -->
<div class="mx-auto max-w-2xl">
<Byline
authors={[
{ name: "Ada Brook-Hallingworth", href: "#ada", image: { src: ada } },
{ name: "Jonas Weber-Lindqvist", href: "#jonas", image: { src: jonas } },
{ name: "Lena Ruiz de Montalbán", href: "#lena", image: { src: lena } },
{ name: "Theodora Achterberg", href: "#theodora" },
{ name: "Maximilian Oyelaran-Smith", href: "#maximilian" },
]}
date="2026-10-14"
readingTime="14 min read"
>
<Button slot="actions" variant="ghost" size="sm"><Icon icon={Share} size="sm" />Share</Button>
</Byline>
</div>
```
### With actions
Your own control in the actions slot, at the end of the row (here a share button: the kit ships no share script), and a hairline under the row through class. The actions wrap under the names, still at the end of the row, only when the marks, a 10rem name column and the actions do not fit side by side.
```astro
---
import Share from "@lucide/astro/icons/share";
import Button from "@astronomic-dev/ui/components/Button.astro";
import Byline from "@astronomic-dev/ui/components/Byline.astro";
import Icon from "@astronomic-dev/ui/components/Icon.astro";
// Your own photo.
import ada from "../../photos/portrait-curly-hair.webp";
---
<div class="mx-auto max-w-2xl">
<Byline
authors={[{ name: "Ada Brook", href: "#ada", image: { src: ada } }]}
readingTime="8 min read"
series={{ label: "Launch notes, part 1", href: "#series-launch" }}
class="border-0 border-b-ui border-solid border-border pb-item"
>
<!-- Your own share control: the kit ships no share script. -->
<Button slot="actions" variant="ghost" size="sm"><Icon icon={Share} size="sm" />Share</Button>
</Byline>
</div>
```
## Props
### Byline
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `authors` | `BylineAuthor[]` | None | Required, one or more: { name, href?, image? } (BylineAuthor). With href the name links to the writer's page. image is { src, width?, height? }, decoration: the part writes alt=""; without one the writer gets their initials. An empty list stops the build. |
| `date` | `DateInput` | None | 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". |
| `dateLabel` | `string` | None | Your own text in place of the printed date. The datetime stays the date. Shown only with a date. |
| `readingTime` | `string` | None | Your own text, such as "8 min read". |
| `series` | `{ label: string; href?: string }` | None | The post's series, after the reading time, such as { label: "Launch notes, part 1", href }. The same prop as ArticleHeader's. |
| `locale` | `string` | `"en"` | The language of the names' joiners ("and", "und") and of the date, such as "de". |
| `class` | `string` | None | More classes for the root <div>, merged with cn(), such as a hairline under it (border-0 border-b-ui border-solid border-border). The root is a named size container (byline). |
| Slot | Description |
| --- | --- |
| `actions` | Your own controls at the end of the row, such as a share button. |
Any other attribute goes on the root <div>.
## Accessibility
- The avatars (photos or initials) are decorative: the names are right beside them. The +N mark is decorative too: every name is in the text.
- The names are one line of real text, joined in the locale's list style; each name with a page is its own link.
- The date is a <time> with a machine date. The middle dots are hidden from screen readers.
- The names are links in a line of text, so WCAG 2.5.5's inline exception applies. As an extra on touch screens, each name, with the comma after it or the "and" before it, is one unit 44px tall that the name's link covers: two names never share a hit area, a short name opens no gap before its comma, and a comma or an "and" never sits on a line alone. The series link in the meta line is a box of 44px at least.
Byline
FreeUnder a post's title: who wrote it, with their photo, the date and the reading time.
- File
- Byline.astro
- Group
- Data display
- Kind
- Static: no JavaScript
- Examples
- 5
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
One writer
The photo, the name (a link to the writer's page), then the date, the reading time and the series, small and muted. Put it in ArticleHeaderPlain's byline slot, or under ArticleHeaderCover.
This preview did not load.
examples/byline/main.astro
---
import Byline from "@astronomic-dev/ui/components/Byline.astro";
// Your own photo.
import ada from "../../photos/portrait-curly-hair.webp";
---
<div class="mx-auto max-w-2xl">
<Byline
authors={[{ name: "Ada Brook", href: "#ada", image: { src: ada } }]}
date="2026-10-14"
readingTime="8 min read"
series={{ label: "Launch notes, part 1", href: "#series-launch" }}
/>
</div>Two writers
The names join in the locale's list style ("Ada Brook and Lena Ruiz"), each its own link; the photos overlap by a quarter. With more than three writers, three marks show and a round +N mark after them.
No photo
A writer without a photo gets their initials in its place (the same rule as Avatar), so the row keeps its shape.
This preview did not load.
examples/byline/no-photo.astro
---
import Byline from "@astronomic-dev/ui/components/Byline.astro";
---
<div class="mx-auto max-w-2xl">
<Byline authors={[{ name: "Jonas Weber", href: "#jonas" }]} date="2026-09-30" readingTime="4 min read" />
</div>Five writers
Five writers with long names: three photos, then a round +2 mark; every name is its own link, and the names wrap inside the box.
With actions
Your own control in the actions slot, at the end of the row (here a share button: the kit ships no share script), and a hairline under the row through class. The actions wrap under the names, still at the end of the row, only when the marks, a 10rem name column and the actions do not fit side by side.
This preview did not load.
examples/byline/with-actions.astro
---
import Share from "@lucide/astro/icons/share";
import Button from "@astronomic-dev/ui/components/Button.astro";
import Byline from "@astronomic-dev/ui/components/Byline.astro";
import Icon from "@astronomic-dev/ui/components/Icon.astro";
// Your own photo.
import ada from "../../photos/portrait-curly-hair.webp";
---
<div class="mx-auto max-w-2xl">
<Byline
authors={[{ name: "Ada Brook", href: "#ada", image: { src: ada } }]}
readingTime="8 min read"
series={{ label: "Launch notes, part 1", href: "#series-launch" }}
class="border-0 border-b-ui border-solid border-border pb-item"
>
<!-- Your own share control: the kit ships no share script. -->
<Button slot="actions" variant="ghost" size="sm"><Icon icon={Share} size="sm" />Share</Button>
</Byline>
</div>