The Button component provides various styles and layouts for creating effective call-to-action elements in your emails. All variants are built using React Email’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sutharjay1/reactui-email/llms.txt
Use this file to discover all available pages before exploring further.
Button component with Tailwind CSS styling.
Variants
ReactUI Email includes five button variants:- Single button - Centered single call-to-action
- Two buttons - Side-by-side primary and secondary actions
- Full width button - Spans the full container width
- Button with icon - Includes an SVG icon alongside text
- Button with border - Bordered button using table wrapper
Single button
A centered button with brand color background, perfect for primary actions.Props
Tailwind CSS classes for styling the button
The URL the button links to
The button text or content
Two buttons
Display primary and secondary actions side-by-side using a Row and Column layout.Two button layout
The two-button layout uses table cells (
<td>) with colSpan={1} to ensure proper spacing in email clients.Full width button
A button that spans the full width of its container, ideal for mobile-first designs.Full width button
w-full- Makes the button span full widthflex items-center justify-center- Centers contentmx-auto- Centers the button in its container
Button with icon
Combine text and icons using nested Row and Column components.Button with
Use inline SVG icons with
currentColor for the stroke/fill to inherit the text color automatically.Button with border
Create bordered buttons by wrapping the Button component in a table with border styles.Button with border
- Inline
styleprop for border properties borderCollapse: "collapse"for clean borderswidth: "fit-content"to wrap button tightly
Customization
Colors
Customize button colors through the Tailwind config:Tailwind config
Sizing
Adjust button size by modifying padding and text size classes:Size variants
Border radius
Change the border radius for different button shapes:Border radius variants
Best practices
- Use semantic URLs - Always provide a valid
hrefthat points to the intended destination - Keep text concise - Button labels should be short and action-oriented (e.g., “Get Started”, “Confirm Email”)
- Prioritize actions - Use the primary brand color for the most important action
- Test across clients - Button rendering varies across email clients; always test your implementation
- Provide alt text - If using icon-only buttons, ensure accessibility with proper ARIA labels