Section

Structural component that defines a horizontal row of content. Used to create the main layout structure of the email by organizing content into rows.

<Section padding="20px" backgroundColor="#f6f6f6">
  <Column>
    <Text>Content</Text>
  </Column>
</Section>
PropTypeDefaultUnitDescription
backgroundColorstring-CSS color valueBackground color of the section
backgroundUrlstring-URLURL of a background image
backgroundPositionstringtop center-Position of background image
backgroundSizestringautopx/% or keywordSize of background image
backgroundRepeatstringrepeat-How background image repeats
borderstringnoneCSS border valueCSS border shorthand
borderTopstring-CSS border valueTop border style
borderRightstring-CSS border valueRight border style
borderBottomstring-CSS border valueBottom border style
borderLeftstring-CSS border valueLeft border style
borderRadiusstring-pxBorder radius for corners
classstring--CSS class name(s) for custom styling*
directionltr|rtlltr-Content direction
fullWidthtrue-Whether section spans full width
paddingstring20px 0pxPadding shorthand for all sides
paddingTopstring-pxTop padding
paddingRightstring-pxRight padding
paddingBottomstring-pxBottom padding
paddingLeftstring-pxLeft padding
textAlignleft|center|right--Text alignment within section

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

Section.Group

A special component that prevents its child columns from stacking on mobile devices. Must be used within a Section component.

<Section>
  <Section.Group>
    <Column width="50%">Left side</Column>
    <Column width="50%">Right side</Column>
  </Section.Group>
</Section>
PropTypeDefaultUnitDescription
backgroundColorstring-CSS color valueBackground color of the group
classstring--CSS class name(s) for custom styling*
directionltr|rtlltr-Content direction
verticalAlignmiddle|top|bottomtop-Vertical alignment of columns
widthstring-px/%Width of the group

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

  • Columns within a Section.Group must use percentage-based widths and their total should equal 100%.
  • For optimal compatibility, avoid whitespace between Column components inside a Group.