Button

A component for creating responsive and stylizable buttons.

<Button
  href="https://example.com"
  backgroundColor="#007bff"
  borderRadius="5px"
  fontSize="16px"
  padding="15px 30px"
>
  Join now
</Button>
PropTypeDefaultUnitDescription
alignleft|center|rightcenter-Horizontal alignment of the button
backgroundColorstring#414141CSS color valueBackground color of the button
borderstringnoneCSS border valueBorder shorthand for all sides
borderBottomstring-CSS border valueBottom border style
borderLeftstring-CSS border valueLeft border style
borderRadiusstring3pxpxBorder radius for corners
borderRightstring-CSS border valueRight border style
borderTopstring-CSS border valueTop border style
classstring--CSS class name(s) for custom styling*
colorstring#ffffffCSS color valueText color of the button
containerBackgroundColorstring-CSS color valueBackground color of button container
fontFamilystringUbuntu, Helvetica, Arial, sans-serif-Font family for button text
fontSizestring13pxpx/emFont size of the button text
fontStylenormal|italic|oblique--Font style of the button text
fontWeightnumber|normal|boldnormal-Font weight of the button text
heightstring-pxFixed height of the button
hrefstring-URLURL the button links to
innerPaddingstring10px 25pxpxInner padding of the button
letterSpacingstring-px/emLetter spacing of the button text
lineHeightstring120%px/%Line height of the button text
paddingstring10px 25pxpxPadding around the button
paddingBottomstring-pxBottom padding
paddingLeftstring-pxLeft padding
paddingRightstring-pxRight padding
paddingTopstring-pxTop padding
relstring--Relationship attribute for the link
target_blank|_self|_parent|_top_blank-Target attribute for the link
textAlignleft|center|right--Text alignment within the button
textDecorationunderline|overline|nonenone-Text decoration style
textTransformcapitalize|uppercase|lowercase--Text transformation
titlestring--Title attribute for the button
verticalAligntop|middle|bottommiddle-Vertical alignment of the button
widthstring-pxFixed width of the button

* CSS class name(s) that correspond to styles defined in the Head component's styles prop.

  • The Button component renders as an HTML link styled as a button, ensuring clickability across different email clients.
  • All styles are inlined for maximum compatibility.