PostByline
Who wrote a post and when, as pieces a caller arranges.
Published 3 min readEvergreen
View code
import { Badge } from "@sdxc/ui";
import { PostByline } from "@sdxc/ui/blog";
<PostByline>
<PostByline.Portrait initials="AP" />
<PostByline.Author href="/about">Ada Park</PostByline.Author>
<PostByline.Facts>
<PostByline.Date date="2026-11-12" />
<PostByline.Updated date="2026-11-20" />
<PostByline.Minutes minutes={8} />
</PostByline.Facts>
</PostByline>
<PostByline dateStyle="long">
<PostByline.Facts>
<PostByline.Date date="2026-10-03">Published</PostByline.Date>
<PostByline.Minutes minutes={3} />
<PostByline.Fact>
<Badge>Evergreen</Badge>
</PostByline.Fact>
</PostByline.Facts>
</PostByline>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { PostByline } from "@sdxc/ui/blog";Renders the byline: a .Portrait beside the .Author and .Facts stacked and centred on
it, or the text alone without one. Every date inside reads locale and dateStyle.
Composition
The parts the component publishes, each a static property of the host.
PostBylinePostByline.PortraitThe author's picture: an avatar fromimageorinitials, or the children in its place, such as a framed photo or a drawn mark.PostByline.AuthorThe author's name, a link to their page withrel="author"when given anhref.PostByline.FactsThe facts as one wrapping line, each child element an item and every item after the first led by the separator, which stays with the fact it introduces when the line wraps.PostByline.DateThe publish day as a<time>in the byline's locale, after the children, such as a word like "Planted".PostByline.UpdatedThe day the post last changed as a<time>, after the children, "Updated" by default.PostByline.MinutesThe reading time: the minute count, then the children, "min read" by default.PostByline.FactAny other fact on the line, such as a badge or a word count, led by the separator like the dates.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
locale | string | — | No | |
dateStyle | "long" | "medium" | "short" | — | No |
Also accepts everything in TagProps<"div">.
PostByline.Portrait
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
image | string | — | No | The avatar's address; the name beside it describes it, so it carries empty alt text. |
initials | string | — | No | Shown in the avatar when there is no image, or while it loads. |
Also accepts everything in TagProps<"span">.
PostByline.Author
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
href | string | — | No | The author's page, which the name links to with rel="author". |
Also accepts everything in TagProps<"p">.
PostByline.Facts
Also accepts everything in TagProps<"p">.
PostByline.Date
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
date | string | — | Yes | The day, YYYY-MM-DD. |
Also accepts everything in TagProps<"span">.
PostByline.Updated
PostByline.Minutes
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
minutes | number | — | Yes | Reading time in whole minutes. |
Also accepts everything in TagProps<"span">.
PostByline.Fact
Also accepts everything in TagProps<"span">.
Types
| Name | Values | What it decides |
|---|---|---|
DateStyle | "long" | "medium" | "short" | How long a formatted day reads. |
Also exported
Other components this module publishes.
formatDay