Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Doc page

One page anatomy for documentation: an icon, title and summary header, a reading column and an On this page rail that becomes a bar on a narrow pane.

Learnings

What engagements taught

Patterns and learnings Updated 20 Oct 2026

What worked

Splitting the call in two: the business logic first, then the tool on screen. Everyone had the whole picture before any detail landed.

What to fix

The specs weren't clear enough before the call. Refine the task descriptions before the kickoff, not after it.

Access on day one

Spaces weren't shared and the field manager wouldn't open. Check workspace access during onboarding.

What became reusable

Three-layer time aggregation, threshold alerts and the invoice cap with carryover.

Installation

pnpm add @heyramzi/ui

Usage

import { DocPage } from "@heyramzi/ui/components/docs";
<DocPage
  title="Learnings"
  summary="What engagements taught"
  headings={[{ id: "what-worked", label: "What worked" }]}
  contentsLabel="On this page"
>
  <h2 id="what-worked">What worked</h2>
  <p>Splitting the call in two.</p>
</DocPage>

Keyboard and accessibility

Key Does
Tab Moves through the contents list and the page's own links and controls.
Space Enter On a contents item, scrolls to that heading.
Esc Closes the contents menu on a narrow page and returns focus to its button.
  • The title is an h1. The contents is a nav named by contentsLabel, and the current heading reports itself as current.
  • On a narrow pane the contents is a button that opens a menu, with focus on the current heading.
  • Picking a heading scrolls to it, at once under reduced motion, but focus stays in the contents list.
  • Picking from the narrow menu, or a click outside it, closes it and returns focus to its button.
  • With reduced motion on, the rail marker and progress line don't animate.

API reference

DocPage

title required string
summary string
One line under the title. Optional: a page with nothing to add leaves it out.
icon Component<{ class?: string; weight?: "bold"; "aria-hidden"?: boolean | "true" | "false"; }>
section string
Where the page lives, as a reader would say it: "Marketing / Reports".
updated string
Already worded and localised: "Updated 30 Jul 2026".
actions Snippet
Room at the right of the title for a page's own controls.
headings DocHeading[]
Default []
The document's h2s, which the contents rail walks. Under two, there's no rail.
contentsLabel required string
The rail's name: "On this page".
locate LocateHeading
Supplied by a document that lives in a frame; the default reads the DOM by id.
resetKey string
Changes when the page is swapped without navigation, so the pane returns to the top.
measure "prose" | "wide"
Default "prose"
The reading column's width. `wide` is for a document that brings tables and boards.
scroller bindable HTMLElement | null
Default null
The scroll box, for a document that has to place things inside it.
children required Snippet
Prop Type Default
title required string
summary

One line under the title. Optional: a page with nothing to add leaves it out.

string
icon Component<{ class?: string; weight?: "bold"; "aria-hidden"?: boolean | "true" | "false"; }>
section

Where the page lives, as a reader would say it: "Marketing / Reports".

string
updated

Already worded and localised: "Updated 30 Jul 2026".

string
actions

Room at the right of the title for a page's own controls.

Snippet
headings

The document's h2s, which the contents rail walks. Under two, there's no rail.

DocHeading[] []
contentsLabel required

The rail's name: "On this page".

string
locate

Supplied by a document that lives in a frame; the default reads the DOM by id.

LocateHeading
resetKey

Changes when the page is swapped without navigation, so the pane returns to the top.

string
measure

The reading column's width. `wide` is for a document that brings tables and boards.

"prose" | "wide" "prose"
scroller bindable

The scroll box, for a document that has to place things inside it.

HTMLElement | null null
children required Snippet

OnThisPage

items required DocHeading[]
active required string
The id the reader is in.
label required string
What the rail is called: "On this page". Passed in so the library holds no copy.
onSelect required (id: string) => void
variant "rail" | "bar" | "ticks"
Default "rail"
`rail` sits beside the document, `bar` replaces it on a narrow pane, and `ticks` marks each heading in the gutter with a card of headings on hover or focus.
Prop Type Default
items required DocHeading[]
active required

The id the reader is in.

string
label required

What the rail is called: "On this page". Passed in so the library holds no copy.

string
onSelect required (id: string) => void
variant

`rail` sits beside the document, `bar` replaces it on a narrow pane, and `ticks` marks each heading in the gutter with a card of headings on hover or focus.

"rail" | "bar" | "ticks" "rail"