# ArticleLayout

> The page a post reads in, as pieces a caller arranges: a header, the body at a reading measure, a footer, the outline as a sticky bar on a narrow layout and a rail beside the body on a wide one.

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

Renders the post as an `<article>` grid: the reading column holds `.Header`, `.Bar`,
`.Body` and `.Footer` in the order written, 2rem apart; a `.Rail` takes a sticky column
beside it from a 60rem layout and hides below that, where `.Bar` shows instead. Load
`@sdxc/ui/table-of-contents` in the browser entry for the outline's marker.

## Examples

```tsx
<ArticleLayout outline={headings}>
	<ArticleLayout.Header><h1>Making the build remember</h1></ArticleLayout.Header>
	<ArticleLayout.Bar>Contents</ArticleLayout.Bar>
	<ArticleLayout.Body><Typeset preset="reading">{body}</Typeset></ArticleLayout.Body>
	<ArticleLayout.Rail><ArticleLayout.Outline /></ArticleLayout.Rail>
</ArticleLayout>
```

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `outline?` | `TableOfContents.Item[]` | The body's own headings, which `.Bar` and `.Outline` list. |
| `outlineMinItems?` | `number` | Fewest headings that earn an outline; below it `.Bar` and `.Outline` draw nothing. @default 2 |
| `measure?` | `string` | The reading column's widest extent. @default "42rem" |
| `stickyTop?` | `string` | The height of a site header kept on screen above the layout, so the bar, the rail and jumped-to headings sit below it. |

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


### ArticleLayout.Header

The post's title block (kind, title, lead, byline) in a `<header>`, in the reading column or spanning the rail too with `span="full"`, where it always sits first, 2.5rem above the rest.

| Prop | Type | Description |
| --- | --- | --- |
| `span?` | `"column" \| "full"` | `column` sets the header in the reading column, level with the rail; `full` spans it across the column and the rail, for a display headline wider than the measure. |

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


### ArticleLayout.Bar

The outline as a sticky bar in the reading column, shown below the rail width or wherever the layout has no rail; it draws nothing when the outline is under its minimum.

Takes no props of its own.

### ArticleLayout.Body

The post's body in the reading column.

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


### ArticleLayout.Footer

What closes the post, such as tags, the author and its neighbours, in a `<footer>` in the reading column.

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


### ArticleLayout.Rail

The sticky column beside the reading column from the rail width, stacking what it holds (an `.Outline`, the terms a post uses) 2rem apart and scrolling on its own when taller than the screen.

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


### ArticleLayout.Outline

The outline as a list of the body's headings with a marker on the one being read, for the rail; it draws nothing when the outline is under its minimum.

| Prop | Type | Description |
| --- | --- | --- |
| `children?` | `string` | The outline's visible heading and accessible name. @default "On this page" |

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

