Skip to content
Alea0.1

Typography

Heading and Text

Headings in Crimson Pro or Inter, body text with tones, the eyebrow label, inline code and keys.

Ant Design: Typography

import { Heading, Text, Eyebrow, Code, Kbd } from '@alea/ui';

Examples

Headings

Crimson Pro Light for titles (serif), Inter for interface headings (sans). Level sets the element, size the look.

Design that plays

Section title

Card title

Interface heading

With the gradient

Text

Sizes, tones and weights from the tokens.

Large lead text for introductions.

Body text at 16 px, the default.

Muted text for secondary details.

Faint text for the least important things.

Saved to the file

Couldn't connect

A long line that gets cut with an ellipsis when it runs out of room.

Eyebrow, code and keys

The small label above a title, inline code and keyboard keys.

Figma plugin

Token Converter

Install with npm i @alea/ui, then press ⌘ K to search.

Props

Heading props

A heading with the Alea type: Crimson Pro light for titles, Inter for UI.

PropTypeDefaultDescription
family"serif" | "sans"'serif'serif (Crimson Pro, light) for titles, sans (Inter, semibold) for UI headings.
gradientboolean-Fills the text with the accent gradient.
level2 | 3 | 4 | 5 | 6 | 12The outline level (h1 to h6). Pick it for the page structure, not the size.
size"md" | "lg" | "display" | "xl" | "4xl" | "3xl" | "2xl"-Visual size; defaults from the level. display is the hero size.

Text props

Body text with the token sizes and tones.

PropTypeDefaultDescription
asElementType'p'The element to render. Default p.
size"sm" | "md" | "lg" | "base" | "xs" | "xl"'base'xs 12, sm 13, md 14, base 16 (default), lg 18, xl 20 px.
tone"danger" | "default" | "success" | "warning" | "accent" | "muted" | "faint"'default'default, muted, faint, accent, success, warning or danger.
truncateboolean-Cut to one line with an ellipsis.
weight"regular" | "medium" | "semibold"-regular, medium or semibold.

Eyebrow props

The small uppercase label above a section title.

PropTypeDefaultDescription
aria-labelstring-Defines a string value that labels the current element. @see aria-labelledby. (React Aria)
autoFocusboolean- (React Aria)
classNamestring- (React Aria)
defaultValuestring | number | readonly string[]- (React Aria)
idstring- (React Aria)
inputMode"none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal"-Hints at the type of data that might be entered by the user while editing the element or its contents @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute} (React Aria)
onChangeChangeEventHandler<HTMLElement, Element>- (React Aria)
onSubmitSubmitEventHandler<HTMLElement>- (React Aria)
roleAriaRole- (React Aria)
styleCSSProperties- (React Aria)

Code props

Inline code.

PropTypeDefaultDescription
aria-labelstring-Defines a string value that labels the current element. @see aria-labelledby. (React Aria)
autoFocusboolean- (React Aria)
classNamestring- (React Aria)
defaultValuestring | number | readonly string[]- (React Aria)
idstring- (React Aria)
inputMode"none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal"-Hints at the type of data that might be entered by the user while editing the element or its contents @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute} (React Aria)
onChangeChangeEventHandler<HTMLElement, Element>- (React Aria)
onSubmitSubmitEventHandler<HTMLElement>- (React Aria)
roleAriaRole- (React Aria)
styleCSSProperties- (React Aria)

Kbd props

A key or shortcut, like ⌘K.

PropTypeDefaultDescription
aria-labelstring-Defines a string value that labels the current element. @see aria-labelledby. (React Aria)
autoFocusboolean- (React Aria)
classNamestring- (React Aria)
defaultValuestring | number | readonly string[]- (React Aria)
idstring- (React Aria)
inputMode"none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal"-Hints at the type of data that might be entered by the user while editing the element or its contents @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute} (React Aria)
onChangeChangeEventHandler<HTMLElement, Element>- (React Aria)
onSubmitSubmitEventHandler<HTMLElement>- (React Aria)
roleAriaRole- (React Aria)
styleCSSProperties- (React Aria)

Accessibility

  • Heading level comes from the outline, size from the design: a small h2 is fine.
  • Muted and faint text tones pass WCAG AA on the default surfaces for their intended sizes; faint is for secondary text only.

Do and don't

Do

  • One h1 per page.
  • Use the eyebrow above a title, not as a heading.

Don't

  • Don't skip heading levels to get a size: set size instead.
  • Don't use faint text for anything people must read.

In Figma

Text styles: Display, 4XL to MD for serif headings, Body and UI sizes, Eyebrow and Code.

Tested with axe, keyboard and screen reader roles