SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

PostByline

Who wrote a post and when, as pieces a caller arranges.

AP

Updated 8 min read

Published 3 min readEvergreen

View code
tsx
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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
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.

  • PostByline
  • PostByline.PortraitThe author's picture: an avatar from image or initials, 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 with rel="author" when given an href.
  • 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.

PropTypeDefaultRequiredDescription
localestring—No
dateStyle"long" | "medium" | "short"—No

Also accepts everything in TagProps<"div">.

PostByline.Portrait

PropTypeDefaultRequiredDescription
imagestring—NoThe avatar's address; the name beside it describes it, so it carries empty alt text.
initialsstring—NoShown in the avatar when there is no image, or while it loads.

Also accepts everything in TagProps<"span">.

PostByline.Author

PropTypeDefaultRequiredDescription
hrefstring—NoThe 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

PropTypeDefaultRequiredDescription
datestring—YesThe day, YYYY-MM-DD.

Also accepts everything in TagProps<"span">.

PostByline.Updated

PostByline.Minutes

PropTypeDefaultRequiredDescription
minutesnumber—YesReading time in whole minutes.

Also accepts everything in TagProps<"span">.

PostByline.Fact

Also accepts everything in TagProps<"span">.

Types

NameValuesWhat it decides
DateStyle"long" | "medium" | "short"How long a formatted day reads.

Other components this module publishes.

  • formatDay
@sdxc/ui

Can’t find it? Contact us