# SeriesNav

> A post's place in a series, built from parts: an eyebrow with the reader's progress, the series name, every part in order with the one being read marked and unlinked, and the next part as the way on.

```ts
import { SeriesNav } from "@sdxc/ui/blog";
```

Renders the box as a `<nav>` stacking whichever parts it holds, named by its
SeriesNav.Title through a generated id, and sharing `current` and `total` with
SeriesNav.Progress. Restyle it through SeriesNav.CustomProperties.

## Examples

```tsx
<SeriesNav current={2} total={3}>
	<SeriesNav.Header>
		<SeriesNav.Label>Series · <SeriesNav.Progress /></SeriesNav.Label>
		<SeriesNav.Title href="/series/sync">Building a sync engine</SeriesNav.Title>
	</SeriesNav.Header>
	<SeriesNav.Parts>
		<SeriesNav.Part href="/sync-1">The change log</SeriesNav.Part>
		<SeriesNav.Part href="/sync-2" current>Merging</SeriesNav.Part>
		<SeriesNav.Part href="/sync-3">Clocks</SeriesNav.Part>
	</SeriesNav.Parts>
	<SeriesNav.Next href="/sync-3">Next: Clocks →</SeriesNav.Next>
</SeriesNav>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `current?` | `number` | The part being read, counted from one, which SeriesNav.Progress states. |
| `total?` | `number` | How many parts the series has. |

Also accepts everything in `TagProps<"nav">`.


### SeriesNav.Header

Stacks the eyebrow over the series name, tight enough to read as one heading.

Also accepts everything in `TagProps<"span">`.


### SeriesNav.Label

The eyebrow: a small upper-case line in the brand colour, such as "Series · Part 2 of 3".

Also accepts everything in `TagProps<"span">`.


### SeriesNav.Progress

The reader's position, "Part n of m", from the box's `current` and `total`; it draws nothing until both are known.

| Prop | Type | Description |
| --- | --- | --- |
| `children?` | `(part: number, total: number) => RemixNode` | Writes the position from the current part and the total. |

Also accepts everything in `Omit<TagProps<"span">, "children">`.


### SeriesNav.Title

The series' name, a link to the series' page when given an `href`; it carries the id that names the box's landmark.

| Prop | Type | Description |
| --- | --- | --- |
| `href?` | `string` | The series' page, which turns the name into a link. |

Also accepts everything in `TagProps<"span">`.


### SeriesNav.Parts

The parts in reading order as a numbered list; the numbers are the list's own markers, so a screen reader hears each part's position.

Also accepts everything in `TagProps<"ol">`.


### SeriesNav.Part

One part: a link that reads as text until hovered, or, for the part being read, its title marked `aria-current="page"` and unlinked, with its number in the brand colour.

| Prop | Type | Description |
| --- | --- | --- |
| `href` | `string` |  |
| `current?` | `boolean` | The part being read, which the list marks with `aria-current` and leaves unlinked. |

Also accepts everything in `TagProps<"li">`.


### SeriesNav.CurrentLabel

A quieter note after the current part's title, such as "(you are here)".

Also accepts everything in `TagProps<"span">`.


### SeriesNav.Next

The link to the part after the current one, in the brand colour: the one link a reader most likely wants.

Takes no props of its own.

### SeriesNav.Last

A closing line for the last part, where there is no next one, such as "The end".

Also accepts everything in `TagProps<"p">`.


### SeriesNav.Disclosure

Folds what follows its SeriesNav.Summary into a native `<details>` that starts open, so a long series can be closed with script off.

Also accepts everything in `TagProps<"details">`.


### SeriesNav.Summary

The disclosure's always-visible line, usually holding the header, with a muted marker.

Also accepts everything in `TagProps<"summary">`.

