Skip to content

Typeset

Echo's type is a set of roles, not a font. A component asks for "the machine voice" or "the screen face", and the theme decides which typeface that is. Change the faces in one place and every component follows.

The four roles

RoleSpecimenUse it forDefault stack
--echo-font-machineREC · 48 kHz · MONITORInstrument labels, caps, panel legends, captions. The library's voice.ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif
--echo-font-sansSettings are saved on this device.Body and UI prose.ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif
--echo-font-mono0O 1lI 5S — 12:04:59Code, data, and digits that have to be told apart at a glance.ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace
--echo-font-lcd-12.4 dBThe screen face on LCD panels and readouts. Tabular by necessity.ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace

The specimens use this site's typefaces; the last column is what a fresh install uses. Those defaults are system fonts, so nothing needs loading until you choose your own.

Choosing your faces

Fonts are part of the seed, so they are set where the colours are:

tsx
const { css } = createEchoTheme({
  accent: "#3D8EF0",
  fontSans: "'Inter', system-ui, sans-serif",
  fontMachine: "'Inter', system-ui, sans-serif",
  fontMono: "'JetBrains Mono', ui-monospace, monospace",
});

Loading the font files is up to you (next/font, a <link>, self-hosting). Keep a system fallback at the end of every stack.

When to use which

  • Machine for anything a device would print on its panel: button labels, section legends, units. Short, often uppercase, letter-spaced.
  • Sans for sentences: descriptions, help text, messages.
  • Mono for anything a person might compare character by character: code, IDs, timestamps, values in a table.
  • LCD only inside a screen: readouts, the LcdChip, chart values. It is tabular, so numbers do not jump as they change.

One size is for one line only: display (the sans, bold and tight, at the scale's 3xl step, 40px) is the one large line a screen carries, like a headline or an entry's index number. A screen has at most one; every other heading is heading.

The scale

TokenSizeSpecimen
--echo-text-3xs0.625remSignal meter
--echo-text-2xs0.6875remSignal meter
--echo-text-xs0.75remSignal meter
--echo-text-sm0.8125remSignal meter
--echo-text-md0.875remSignal meter
--echo-text-lg1remSignal meter
--echo-text-xl1.25remSignal meter
--echo-text-2xl1.625remSignal meter
--echo-text-3xl2.5remSignal meter

Component CSS takes every font size from this scale. It is in rem, so it follows the reader's browser text size.

Weights, line heights and letter-spacing have scales too:

ScaleTokenValue
Weight--echo-weight-regular400
Weight--echo-weight-semibold600
Weight--echo-weight-bold700
Weight--echo-weight-heavy800
Line height--echo-leading-none1
Line height--echo-leading-tight1.25
Line height--echo-leading-snug1.4
Line height--echo-leading-body1.55
Letter-spacing--echo-tracking-tighter-0.02em
Letter-spacing--echo-tracking-tight-0.01em
Letter-spacing--echo-tracking-normal0
Letter-spacing--echo-tracking-wide0.06em
Letter-spacing--echo-tracking-wider0.12em
Letter-spacing--echo-tracking-label0.2em
Letter-spacing--echo-tracking-widest0.25em

Text styles

A text style bundles a face, size, weight, line height and tracking under the job it does. Use one by name instead of picking five values:

StyleBuilt fromSpecimen
--echo-type-machine-labelmachine, 3xs, bold, leading tight, tracking label, uppercaseOutput level
--echo-type-bodysans, md, regular, leading body, tracking normalThe signal drops out when the cable is loose.
--echo-type-body-smsans, sm, regular, leading body, tracking normalChanges apply to every channel on this device.
--echo-type-captionsans, xs, regular, leading snug, tracking normalLast synced 2 minutes ago
--echo-type-headingmachine, lg, bold, leading tight, tracking tightDelete this preset?
--echo-type-readoutlcd, xl, regular, leading none, tracking normal-12.4 dB
--echo-type-displaysans, 3xl, bold, leading none, tracking tighter017

letter-spacing and text-transform aren't part of the CSS font shorthand, so each style comes as three tokens:

css
.panel-label {
  font: var(--echo-type-machine-label);
  letter-spacing: var(--echo-type-machine-label-tracking);
  text-transform: var(--echo-type-machine-label-case);
}

The machine label is Echo's voice: small, uppercase and spaced out, like the legend printed on a panel. Keep it for labels of two or three words. A sentence in spaced capitals is hard to read.