Single button
The most basic button variant with a solid background color and rounded corners.Tailwind classes for styling. Common patterns:
bg-brand- Brand color backgroundrounded-[8px]- 8px border radiuspx-[24px] py-[12px]- Horizontal and vertical paddingtext-[14px]- Font sizefont-semibold- Font weight
The URL the button links to
Use explicit pixel values like
rounded-[8px] instead of Tailwind’s semantic values (rounded-lg) for better email client compatibility.Button with icon
A button with an icon element positioned next to the text, typically used to indicate direction or action type.Icon positioning
You can position icons before or after text by reordering theColumn components within the Row:
- Icon after text: Place icon
Columnafter textColumn - Icon before text: Place icon
Columnbefore textColumn
Button with border
A bordered button variant that wraps the button in a table with border styling. This creates a distinct outline effect.The border effect is achieved by wrapping the button in a
table element with inline styles. This technique ensures consistent rendering across email clients.Border customization
You can customize the border appearance through the table’s inline styles:Border width and color, e.g.,
1px solid rgb(39 39 42 / 0.2)Corner rounding, e.g.,
8pxTwo button layout
A side-by-side button layout for presenting primary and secondary actions.Set to
1 for each button cell to ensure equal width distributionUse
center alignment for consistent button positioningStyling conventions
For two-button layouts, follow these patterns:- Primary button: Solid background with brand color
- Secondary button: White background with border
Full width button
A button that spans the full width of its container.Makes the button stretch to fill the container width
Centers the button horizontally (use with
flex)Common props
All button variants support these standard React Email Button props:The destination URL when the button is clicked
Tailwind CSS classes for styling
Inline CSS styles (use sparingly, prefer className)
Button content (text, icons, or nested components)
Best practices
Accessibility: Always use descriptive button text that clearly indicates the action. Avoid generic labels like “Click here.”
Design guidelines
- Use a minimum padding of
px-[20px] py-[10px]for adequate touch targets - Maintain consistent button heights across variants (typically 12px vertical padding)
- Ensure sufficient color contrast between button background and text (WCAG AA: 4.5:1 minimum)
- Limit button text to 2-4 words for better scannability
Color considerations
When choosing button colors:- Use your brand color for primary CTAs
- Ensure the color works on both light and dark backgrounds
- Test colors across different email clients and devices
- Provide fallback colors for clients that don’t support your Tailwind config