Components Data display

Typography

Set an editorial hierarchy for a small, readable block of content.

Live previewGo + HTML

Field notes

Reading the margins

A generous margin gives a page its pace.

Start with a short measure and add space between ideas. Each new paragraph should give the reader a place to pause.

Excerpt from the print workshop journal.

Usage

Use Eyebrow, Title, Lead, Body and optional Caption to structure an excerpt. Adapt the heading level to the document that contains the component.

Register typography with Head and pass its properties to Render. Go setup guide

Go usage
Go usage
err := mono.UI.Render(w, "typography", mono.Props{
	"Body":    "Start with a short measure and add space between ideas. Each new paragraph should give the reader a place to pause.",
	"Caption": "Excerpt from the print workshop journal.",
	"Eyebrow": "Field notes",
	"Lead":    "A generous margin gives a page its pace.",
	"Title":   "Reading the margins",
})
Rendered HTML
Rendered HTML
<article data-mono="typography" id="demo-typography" class="mu-stack">
  <p class="mu-small mu-muted">Field notes</p>
  <h3>Reading the margins</h3>
  <p class="mu-type-lead">A generous margin gives a page its pace.</p>
  <p>Start with a short measure and add space between ideas. Each new paragraph should give the reader a place to pause.</p>
  <p class="mu-small mu-muted">Excerpt from the print workshop journal.</p>
</article>
Go template
Go template
<article data-mono="typography" id="{{.ID}}" class="mu-stack">
  {{with .Eyebrow}}<p class="mu-small mu-muted">{{.}}</p>{{end}}
  <h3>{{.Title}}</h3>
  {{with .Lead}}<p class="mu-type-lead">{{.}}</p>{{end}}
  <p>{{.Body}}</p>
  {{with .Caption}}<p class="mu-small mu-muted">{{.}}</p>{{end}}
</article>
Component CSS
Component CSS
[data-mono="typography"] { max-width:58ch; }
[data-mono="typography"] h3 { margin:0; font:500 clamp(1.65rem,4vw,2.5rem)/1.05 Georgia,serif; letter-spacing:-.05em; }
[data-mono="typography"] .mu-type-lead { font-size:1.12rem; font-weight:550; }
Use the HTML in a static site

Copy the rendered HTML above. Download these assets into the same folder as your page, then add the tags below to its head.

Shared CSS Component CSS

HTML head
<link rel="stylesheet" href="./base.css">
<link rel="stylesheet" href="./typography.css">

Copy into your project

Run this command from the Mono checkout. Set -out to the component directory in your application.

Terminal
go run ./cmd/mono-ui add -out ./components typography
Example properties (JSON)
example.json
{
  "Body": "Start with a short measure and add space between ideas. Each new paragraph should give the reader a place to pause.",
  "Caption": "Excerpt from the print workshop journal.",
  "Eyebrow": "Field notes",
  "Lead": "A generous margin gives a page its pace.",
  "Title": "Reading the margins"
}