Flab UIv0.0.2
MobileA2UI

Text

The typographic primitive over the nine-step scale. Hierarchy comes from variant and tone, not a memorised set of utility classes.

Variants

Display

Heading

Title

Body

Caption

<Text variant="display">Display</Text><Text variant="heading">Heading</Text><Text variant="title">Title</Text><Text variant="body">Body</Text><Text variant="caption">Caption</Text>

Tones

Primary

Secondary

Tertiary

<Text tone="primary">Primary</Text><Text tone="secondary">Secondary</Text><Text tone="tertiary">Tertiary</Text>

Polymorphic

Page title

<Text variant="heading" render={<h1 />}>Page title</Text>

Use render to change the element without losing the typography.

Props

PropTypeDefaultNotes
variant'display' | 'heading' | 'title' | 'body' | 'caption' | …'body'Size and weight from the type scale.
tone'primary' | 'secondary' | 'tertiary' | 'accent' | 'danger' | …'primary'Text colour.
truncatebooleanfalseSingle-line ellipsis.
numericbooleanfalseTabular figures.
renderReactElement—Swap the rendered element.