DesignOverviewDesign SystemMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingAgentsCortexMemoryActiveProvenanceActiveContextActiveServicesInsightsGet in touchSource on GitHub
Foundations
TypographyFont familiesTokenValueFor--helix-font-sansui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serifAll text except code and display headings.--helix-font-monoui-monospace, SFMono-Regular, "SF Mono", Menlo, monospaceCode, and text that needs to line up in columns.--helix-font-displayui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serifLarge display headings. Falls back to the sans face.Helix has three font families, three weights, and no widths. A design system
with more families or weights than a product uses ends up with two that mean the
same thing.The type scaleThe type scale runs from --helix-text-xs to --helix-text-3xl.
--helix-text-control sets the size of a control's own text. It follows the
region's density and is separate from the type scale. A field you type into
takes two more that follow density:
--helix-text-field is the value you type: 13px at sm, and 14px at md
and lg.
--helix-text-field-label is the field's label, a step under its value: 12px
at sm, and 13px at md and lg.
TokenSize--helix-text-xs12px--helix-text-sm13px--helix-text-md14px--helix-text-lg18px--helix-text-xl24px--helix-text-2xl32px--helix-text-3xl42pxA ramp sets the size, weight, leading, and letter spacing of text together.
[data-text] and the scale property of Text take the same nine ramps:RampSizeWeightdisplay42px600, in the display faceheading32px600subheading24px600title18px600body14px400body-strong14px500caption13px400label12px500code13px400, in the mono faceText maps each heading level onto a ramp, and so do the headings inside
[data-prose]:ElementRamph1displayh2headingh3subheadingh4titleh5 and h6body-strongSet scale to choose a ramp yourself.On a touch screen, text you type is at least 16px. iOS Safari zooms the
page into a focused input, textarea, or select whose text is smaller than
16px. --helix-text-field-min is the smallest size a field's text can take:
16px where the primary pointer is coarse, and 0 everywhere else. Every field
sets its text to the larger of this token and its own size, so the desktop
sizes do not change. To keep the desktop sizes on a touch screen as well, set
the token in a stylesheet loaded after Helix's::root{--helix-text-field-min:0px;}Leave the viewport's maximum-scale and user-scalable alone. Setting
either one to stop the zoom also stops a reader from zooming the page.The base layer applies the scale to heading elements.:where([data-prose]h1){font-size:var(--helix-text-3xl);}:where([data-prose]h2){font-size:var(--helix-text-2xl);}Because the styles target the elements, a heading's markup and its appearance
match by default. The styles also reach prose that Helix does not render.
Content from a CMS, a Markdown file, or a rich-text field is styled correctly
inside [data-prose], with no changes to the content.Use Text when a heading's element and its appearance need to differ. A
section's second heading may need to look smaller and keep its place in the
outline. A <p> may need to look like a caption. as chooses the element, and
scale chooses the ramp:<helix-textas="h3"scale="body">Reads as body, outlines as a heading</helix-text>By default the two match, so most headings need only as="h2". CSS resolves
the match. Text does not write an attribute onto the host element, because
that would cause a hydration mismatch in every React app. Size, weight, and
leading are not properties. Each ramp already sets them, and setting them one
by one would allow a few hundred combinations, of which only a handful are
right. There is no separate Heading component, because as does that job.Style your own text<articledata-prose><h2>A real heading</h2><p>Body text, at the right measure and leading.</p></article>Put [data-prose] on the element that contains your text. Inside it, the token
layer does the following:
It sets the size, weight, and leading of each heading.
It ends each paragraph, list, quote, table, and block of code with one gap,
--helix-space-sm.
It styles links and code.
A heading takes no space of its own. The space above a heading is the gap
after the block before it, and the block after it starts on the next line. Set
the space around headings in your own stylesheet::where([data-prose]:is(h2,h3)){margin-block:var(--helix-space-xl)var(--helix-space-sm);}Prose fills its column.data-prose sets no measure, so a paragraph is as
wide as the column it sits in. Set the measure on the column, as a Chat and an
Editor do, or use reading.Set a document for reading with data-prose="reading". The default size
is 14px, which suits a reply in a chat bubble or a note in a panel. A
documentation page or an article reads better larger:<articledata-prose="reading"><h2>Install the connector</h2><p>Text at 18px on a 27px line, about 70 characters wide.</p></article>reading makes the following changes:
It sets the text at --helix-text-lg, on --helix-leading-normal.
It ends each block with --helix-space-md.
It stops paragraphs, lists, and quotes at 34em.
It sets a table at 16px, between md and lg.
For one-off text outside prose, use [data-text] to set the ramp:<spandata-text="caption">Fine print</span>Line height, letter spacing, and weightTokenValueFor--helix-leading-tight1.2Body text set close, for short lines.--helix-leading-snug1.4One line of small type on a plate, such as a chart label.--helix-leading-normal1.5Body text. The default line height for a paragraph.--helix-leading-loose1.7Body text set open, for long lines or small sizes.--helix-leading-headinground(up, calc(0.99em + 0.5rem), 1px)Headings, which need less line height than a paragraph. It is a length plus an em, so it tightens as the type grows.TokenValueFor--helix-tracking-tight-0.01emLarge type, which needs tighter letter spacing than a paragraph.--helix-tracking-normal0Body text. The default letter spacing.--helix-tracking-wide0.02emLabels and small capitals, which need extra letter spacing.--helix-tracking-wider0.12emUppercase eyebrows, which need more letter spacing than a label.TokenValueFor--helix-weight-regular400Body text. Most of a page uses this weight.--helix-weight-medium500Labels, and quieter headings.--helix-weight-semibold600Headings. The heaviest weight in Helix.Most text takes tight, normal, or loose. --helix-leading-snug is for
one line of small type on a plate of its own, such as a Donut Chart's slice
label, a Sparkline's reading, or a count in a Log line.Headings have their own leading token. At a paragraph's line height, a
heading looks loose at every size. The fix is not proportional, because larger
type needs less leading. --helix-leading-heading expresses that once, so no
heading level needs its own multiplier.