Skip to content

Prose page

The frame of a page that is mostly words: a title band across the page, then one reading column.

<main>
  <header class="cap-prose-page-head">
    <h1 class="cap-prose-page-title">About us</h1>
    <p class="cap-prose-page-lead">Example Co has edited research writing since 2001.</p>
  </header>
  <div class="cap-prose-page-body" data-context="prose">
    <p>Example Co was founded by Alex Rivera to give researchers a reader who knows their field.</p>
    <h2>Our editors</h2>
    <p>Each editor has published in a peer-reviewed journal. <a href="#team">Meet the team</a>.</p>
    <ul><li>Field notes</li><li>Annual report</li></ul>
  </div>
</main>

Installation

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

Usage

<header class="cap-prose-page-head">
  <h1 class="cap-prose-page-title">About us</h1>
  <p class="cap-prose-page-lead">One line under the title.</p>   <!-- optional -->
</header>
<div class="cap-prose-page-body" data-context="prose">
  <p>...</p>
</div>

Examples

Long title, no lead

<main>
  <header class="cap-prose-page-head">
    <h1 class="cap-prose-page-title">Security, confidentiality and how your manuscript is kept</h1>
  </header>
  <div class="cap-prose-page-body" data-context="prose">
    <p>Files are kept for 30 days and then deleted.</p>
  </div>
</main>

API reference

ProsePageHead

PropTypeRequiredDoes
titleReactNodeYes
leadReactNode
headExtraReactNodeSomething under the title in the band (a date, a button).
titleIdstringThe id of the h1, for a link to the top.

ProsePage

PropTypeRequiredDoes
childrenReactNode
htmlstringThe body as HTML the server already sanitized (a page stored as HTML), in place of children, through the capsomer Trusted Types policy.
titleReactNodeYes
leadReactNode
headExtraReactNodeSomething under the title in the band (a date, a button).
titleIdstringThe id of the h1, for a link to the top.

CSS variables

VariableDefault
--cap-prose-page-body-padvar(--space-8)
--cap-prose-page-head-bgvar(--sunken)
--cap-prose-page-head-padvar(--space-9)
--cap-prose-page-head-textvar(--text)
--cap-prose-page-lead-textvar(--muted)
--cap-prose-page-measure48rem
--cap-prose-page-title-casenone
--cap-prose-page-title-facevar(--display)
--cap-prose-page-title-leadingvar(--leading-tight)
--cap-prose-page-title-max40rem
--cap-prose-page-title-sizevar(--title-display)
--cap-prose-page-title-trackingvar(--tracking-snug)
--cap-prose-page-title-weightvar(--weight-title)
--cap-prose-page-title-wrapbalance

Parts and data attributes

ClassIs
.cap-prose-page-bodyits own class
.cap-prose-page-headthe root
.cap-prose-page-leadits own class
.cap-prose-page-titleits own class

Accessibility

Nothing to operate; links in the body are in reading order.

  • The title is the page's one h1.
  • The band's text pair is the site's to check when it sets its own band colors; the default (--text on --sunken) is in the contrast report.