Skip to Content
Docs🏗️ ⏐ ComponentsTypographyTypography

Typography

The typography components are semantic HTML wrappers that ship with sensible defaults for every level of headings and body text. They’re designed to be composed and styled with Tailwind utility classes via className or via the shared typography theme.

Components

  • H1 – page title
  • H2 – primary section heading
  • H3 – sub-section heading
  • H4 – small heading
  • H5 – tertiary heading
  • H6 – smallest heading
  • P – paragraph / body text
  • Lead – emphasized intro paragraph
  • Large – emphasized inline text
  • Small – de-emphasized inline text
  • Muted – muted helper text
  • BlockQuote – block quotation

Quick Start

To start using the typography components, import them from reablocks.

Welcome

Build beautiful interfaces with reablocks.

Last updated today.

Examples

Headings

Paragraphs

Lead

Large, Small, and Muted

BlockQuote

Everything together

Customizing with className

The old color, variant, fontStyle, and disableMargins props were removed in 10.0.0. Apply Tailwind utilities directly via className, or override the shared theme to change defaults globally.

import { H1, P } from 'reablocks'; <H1 className="text-primary tracking-tight">Title</H1> <P className="font-bold italic">Bold italic body</P>

Theme

Typography uses a per-element theme. Every key maps to a single string of Tailwind classes that’s applied to that semantic element.

  • root{}(12 keys)
      Show all
interface TypographyTheme { h1: string; h2: string; h3: string; h4: string; h5: string; h6: string; p: string; blockquote: string; lead: string; large: string; small: string; muted: string; }

Learn more about how to customize in the Theme documentation.

API

H1

NameTypeDefault
themeTypographyTheme

Theme for Typography.

H2

NameTypeDefault
themeTypographyTheme

Theme for Typography.

H3

NameTypeDefault
themeTypographyTheme

Theme for Typography.

H4

NameTypeDefault
themeTypographyTheme

Theme for Typography.

H5

NameTypeDefault
themeTypographyTheme

Theme for Typography.

H6

NameTypeDefault
themeTypographyTheme

Theme for Typography.

P

NameTypeDefault
themeTypographyTheme

Theme for Typography.

Lead

NameTypeDefault
themeTypographyTheme

Theme for Typography.

Large

NameTypeDefault
themeTypographyTheme

Theme for Typography.

Small

NameTypeDefault
themeTypographyTheme

Theme for Typography.

Muted

NameTypeDefault
themeTypographyTheme

Theme for Typography.

BlockQuote

NameTypeDefault
themeTypographyTheme

Theme for Typography.

Migrating from 9.x

BeforeAfter
PageTitleH1
PrimaryHeadingH2
SecondaryHeadingH3
SmallHeadingH4
SubH5
<Text>P, Small, or Muted
<Text fontStyle="bold"><P className="font-bold" />
<Text color="primary"><P className="text-primary" />
<Text variant="mono"><P className="font-mono" />

See the full guide in Migration.

Last updated on