Reference · SemText · Document & structure
<sem-reader>
SemText element
It is page furniture, not content — a document without it loses nothing a machine would read. Readers get focus mode, type size, colour scheme, print, and audience controls in one place.
Children
-
<nav>Child (optional): an authored `<nav aria-label="Contents">`. When present it is the outline, **used verbatim** — no ids are assigned, no list is generated, nothing inside it is rewritten. This is the JS-off table of contents.
Example
Live render boots with JavaScript — the authored source is alongside.
variant: in a document
The reader in its habitat: first child of the root wrapper, all seven controls. The outline derives from the document's h2–h3 headings (one link per heading, `aria-current="location"` on the topmost one in view); the progress bar fills with the document scroll; focus, type and colour write session attributes on `<html>`, persisted per control via localStorage — fail-open. This page's pane is not a long document, so the full chrome is honest only in a real document (see the site's demo build).
Live render boots with JavaScript — the authored source is alongside.
variant: outline only, depth 2
`outline-depth="2"` caps the outline at h2: the h3 headings still render in the document but stay out of the contents. `controls="outline"` drops the progress bar and every preference control — only the Contents toggle renders.
Live render boots with JavaScript — the authored source is alongside.
variant: audience control
The audience select renders only when the document declares profiles: it lists every `sem-profile` (label, else id) under a leading `Everyone`, and the choice writes the shareable `sem-audience` hash parameter — the audience handler applies it on `hashchange`; the reader never hides anything itself. No declared profiles, no control.
Live render boots with JavaScript — the authored source is alongside.
Source: spec/schema/sem-reader.md