Skip to main content
Typography components provide email-safe text rendering with sensible defaults and full Tailwind CSS support.

Heading

Flexible heading component that can render h1 through h6 elements with margin utilities.

Props

as
'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
default:"h2"
The heading level to render
children
snippet
required
Heading text content
style
string
Inline CSS styles
class
string
Tailwind CSS classes or custom CSS classes

Margin Utilities

The Heading component supports shorthand margin props:
m
string
Margin on all sides (e.g., “16px”)
mx
string
Horizontal margin (left and right)
my
string
Vertical margin (top and bottom)
mt
string
Margin top
mr
string
Margin right
mb
string
Margin bottom
ml
string
Margin left
All standard HTML heading attributes are supported via HTMLAttributes<HTMLHeadingElement>.

Usage

<Heading as="h1" class="text-2xl font-bold">
  Welcome to Our Newsletter
</Heading>
<Heading as="h1" class="text-3xl font-bold">
  Main Title
</Heading>

<Heading as="h2" class="text-2xl font-semibold">
  Section Title
</Heading>

<Heading as="h3" class="text-xl">
  Subsection Title
</Heading>

Text

Paragraph text component with email-safe default styling.

Props

as
string
default:"p"
HTML element to render (p, span, div, etc.)
children
snippet
required
Text content
style
string
Inline CSS styles (merged with defaults)
class
string
Tailwind CSS classes or custom CSS classes
All standard HTML paragraph attributes are supported via HTMLAttributes<HTMLParagraphElement>.

Default Styles

  • font-size: 14px - Email-safe base size
  • line-height: 24px - Comfortable reading
  • margin: 16px 0 - Vertical spacing

Usage

<Text class="text-gray-700">
  This is a paragraph of text in your email.
</Text>
<Text>
  This is a standard paragraph with default styling.
</Text>

<Text class="text-gray-600">
  This paragraph has custom text color.
</Text>

Typography Combinations

Here are common patterns combining Heading and Text:
<Section class="mb-8">
  <Heading as="h1" mb="16px" class="text-3xl font-bold text-gray-900">
    Your Weekly Newsletter
  </Heading>
  
  <Heading as="h2" mb="12px" class="text-xl font-semibold text-gray-800">
    Feature Article
  </Heading>
  
  <Text class="mb-4 text-gray-700">
    This week we're excited to share some amazing updates with you.
    Our team has been working hard to bring you new features.
  </Text>
  
  <Text class="text-gray-700">
    Read on to learn about what's new and how you can take advantage
    of these improvements.
  </Text>
</Section>

Best Practices

Use semantic heading levels (h1, h2, h3) to create proper document structure, even though visual styling can be customized with Tailwind classes.
The Text component’s default styles are optimized for email readability. Override with caution and always test in multiple email clients.
Avoid using very small font sizes (below 12px) as they may be difficult to read on mobile devices.
Use the margin utility props (m, mx, my, mt, mr, mb, ml) on Heading for precise spacing control that works consistently across email clients.
When using as="span" on Text components, remember that margin utilities may not work as expected since spans are inline elements.

Build docs developers (and LLMs) love