The Header component provides multiple layouts for email headers, including logo placement, date displays, and navigation links. All variants use email-safe table layouts for maximum compatibility.
Variants
ReactUI Email includes three header variants:
Header one - Logo left, date right
Header two - Centered logo with navigation links
Spline header - Centered logo with horizontal rule divider
A horizontal header with logo on the left and date on the right.
Header component
Complete example
import { Column , Img , Row , Text } from "@react-email/components" ;
< Section className = "my-0" >
< table className = "w-full" cellPadding = "0" cellSpacing = "0" role = "presentation" >
< tr >
< td >
< Row >
< Column align = "left" >
< Img
src = "https://cdn.brandfetch.io/idZ_aiFAYa/w/128/h/128/theme/dark/logo.png"
width = "40"
height = "40"
alt = "Framer"
/>
</ Column >
< Column align = "right" >
< Text className = "m-0 text-sm font-semibold text-primary" >
{new Date (). toLocaleDateString () }
</ Text >
</ Column >
</ Row >
</ td >
</ tr >
</ table >
</ Section >
Props
Alternative text for the logo image
A centered logo with navigation links below a horizontal rule.
import { Column , Hr , Img , Link , Row , Section , Text } from "@react-email/components" ;
< Section className = "mt-2 flex w-full flex-col items-center justify-center" >
< Img
src = "https://cdn.brandfetch.io/idZ_aiFAYa/w/128/h/128/theme/dark/logo.png"
width = "50"
height = "50"
alt = "Framer"
className = "mx-0 my-0"
/>
</ Section >
< Hr className = "my-4 border-primary" />
< Section className = "my-2" >
< table className = "w-full" cellPadding = "0" cellSpacing = "0" role = "presentation" >
< tr >
< td >
< Row >
< Column align = "left" style = { { width: "25%" } } >
< Link href = "https://reactui.email" target = "_blank" rel = "noopener noreferrer" >
< Text className = "m-0 text-center text-sm font-semibold text-primary" >
Docs
</ Text >
</ Link >
</ Column >
< Column align = "center" style = { { width: "25%" } } >
< Link href = "https://reactui.email" target = "_blank" rel = "noopener noreferrer" >
< Text className = "m-0 text-center text-sm font-semibold text-primary" >
Blog
</ Text >
</ Link >
</ Column >
< Column align = "right" style = { { width: "25%" } } >
< Link href = "https://reactui.email" target = "_blank" rel = "noopener noreferrer" >
< Text className = "m-0 text-center text-sm font-semibold text-primary" >
Help
</ Text >
</ Link >
</ Column >
</ Row >
</ td >
</ tr >
</ table >
</ Section >
This variant uses the Hr component to create a visual separator between the logo and navigation.
Navigation structure
The navigation uses a three-column layout with equal width distribution:
Each Column has width: "25%" for consistent spacing
align prop controls text alignment within each column
Links use target="_blank" and rel="noopener noreferrer" for security
A minimal centered logo with horizontal rule divider.
import { Hr , Img , Section } from "@react-email/components" ;
< Section className = "mt-2 flex w-full flex-col items-center justify-center" >
< Img
src = "https://cdn.brandfetch.io/idZ_aiFAYa/w/128/h/128/theme/dark/logo.png"
width = "50"
height = "50"
alt = "Framer"
className = "mx-0 my-0"
/>
</ Section >
< Hr className = "my-4 border-primary" />
This is the simplest header variant, perfect for:
Minimalist email designs
Transactional emails where navigation isn’t needed
Focus on email content rather than branding
Customization
Logo sizing
Adjust logo dimensions to match your brand:
// Small
< Img width = "32" height = "32" />
// Medium (default)
< Img width = "40" height = "40" />
// Large
< Img width = "60" height = "60" />
Navigation links
Customize the number and content of navigation links:
< Row >
< Column align = "left" style = { { width: "20%" } } >
< Link href = "/products" >
< Text className = "m-0 text-center text-sm font-semibold text-primary" >
Products
</ Text >
</ Link >
</ Column >
< Column align = "center" style = { { width: "20%" } } >
< Link href = "/pricing" >
< Text className = "m-0 text-center text-sm font-semibold text-primary" >
Pricing
</ Text >
</ Link >
</ Column >
< Column align = "center" style = { { width: "20%" } } >
< Link href = "/docs" >
< Text className = "m-0 text-center text-sm font-semibold text-primary" >
Docs
</ Text >
</ Link >
</ Column >
< Column align = "right" style = { { width: "20%" } } >
< Link href = "/support" >
< Text className = "m-0 text-center text-sm font-semibold text-primary" >
Support
</ Text >
</ Link >
</ Column >
</ Row >
Adjust the width percentage based on the number of navigation items to maintain equal spacing.
Customize the date display format:
// Default locale format
{ new Date (). toLocaleDateString ()}
// Specific locale
{ new Date (). toLocaleDateString ( 'en-US' , {
month: 'long' ,
day: 'numeric' ,
year: 'numeric'
})}
// Custom format
{ new Date (). toLocaleDateString ( 'en-US' , {
weekday: 'long' ,
year: 'numeric' ,
month: 'short' ,
day: 'numeric'
})}
Horizontal rule styling
Customize the divider appearance:
// Primary color
< Hr className = "my-4 border-primary" />
// Gray
< Hr className = "mb-6 mt-8 border-gray-200" />
// Thicker line
< Hr className = "my-4 border-2 border-primary" />
Best practices
Optimize images - Use appropriately sized images and consider 2x versions for retina displays
Provide alt text - Always include descriptive alt text for accessibility
Keep navigation simple - Limit navigation links to 3-5 items for better mobile experience
Use consistent branding - Ensure logo and colors match your brand guidelines
Test across clients - Header layouts can vary across email clients; always test
Accessibility
Ensure your headers are accessible:
< table
className = "w-full"
cellPadding = "0"
cellSpacing = "0"
role = "presentation" // Indicates decorative table
>
< tr >
< td >
< Img
src = "/logo.png"
width = "40"
height = "40"
alt = "Company name logo" // Descriptive alt text
/>
</ td >
</ tr >
</ table >
Use role="presentation" on layout tables
Provide meaningful alt text for images
Ensure sufficient color contrast for text
Source code
View the complete source code for all header variants: