Skip to content

Legal page

A policy or terms page with a title, change date, numbered contents and numbered sections.

<div data-mount="doc" id="sample-doc"></div>

Installation

// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/legal-doc.css";

Usage

<article class="cap-legal">
  <header class="cap-legal-head"><h1 class="cap-legal-title">Privacy policy</h1>
    <p class="cap-legal-updated">Last updated <time datetime="2026-11-11">November 11, 2026</time></p></header>
  <nav class="cap-legal-contents" aria-labelledby="c"><h2 id="c" class="cap-legal-contents-title">Contents</h2><ol><li><a href="#what-we-keep">What we keep</a></li></ol></nav>
  <ol class="cap-legal-sections"><li><section aria-labelledby="what-we-keep"><h2 id="what-we-keep" class="cap-legal-section-title"><span class="cap-legal-num">1.</span> What we keep</h2><div class="cap-legal-body">...</div></section></li></ol>
</article>

API reference

LegalDoc

PropTypeRequiredDoes
titleReactNodeYes
updatedstringYesThe day the text last changed, YYYY-MM-DD. The same date belongs in the sitemap's lastmod.
sectionsreadonly LegalSection[]Yes
introReactNodeText before the contents (a summary card, an unnumbered preamble).
outroReactNodeText after the last section (contact lines).
contentsLabelstring
updatedLabelstring
headingLevel"h1" | "h2"
classNamestring

Parts and data attributes

ClassIs
.cap-legalthe root
.cap-legal-bodya part
.cap-legal-contentsa part
.cap-legal-contents-titlea part
.cap-legal-introa part
.cap-legal-numa part
.cap-legal-outroa part
.cap-legal-section-titlea part
.cap-legal-sectionsa part
.cap-legal-titlea part
.cap-legal-updateda part

Accessibility

KeyDoes
TabThrough the contents links, then the links in the text
Enter on a contents linkMoves to that section
  • One h1 (or h2 inside a page that has one), sections at the next level, the contents a named navigation.
  • Screen readers: no manual NVDA or VoiceOver run, by decision (2026-11-07); the automated browser checks and a front-end review stand in. Automated: see the site's Tests page.