Container

A wrapper component that groups sections together and provides background styling capabilities. Helps create consistent layouts and background treatments across email clients.

<Container
  backgroundColor="#f6f6f6"
  backgroundUrl="https://example.com/bg.jpg"
  backgroundSize="cover"
  padding="40px 20px"
>
  <Section>
    <Column>
      <Text>Content with background</Text>
    </Column>
  </Section>
</Container>
PropTypeDefaultUnitDescription
backgroundColorstring-CSS color valueBackground color of the container
backgroundPositionstringtop center-Position of background image
backgroundPositionXstringnone-Horizontal position of background image
backgroundPositionYstringnone-Vertical position of background image
backgroundRepeatstringrepeat-How background image should repeat
backgroundSizestring|cover|contain-px/% or keywordSize of background image
backgroundUrlstring-URLURL of background image
borderstringnoneCSS border valueBorder shorthand for all sides
borderBottomstring-CSS border valueBottom border style
borderLeftstring-CSS border valueLeft border style
borderRadiusstring-pxBorder radius for corners
borderRightstring-CSS border valueRight border style
borderTopstring-CSS border valueTop border style
classstring--CSS class name(s) for custom styling *
fullWidthstring--Whether container spans full width
paddingstring20px 0pxPadding shorthand for all sides
paddingBottomstring-pxBottom padding
paddingLeftstring-pxLeft padding
paddingRightstring-pxRight padding
paddingTopstring-pxTop padding
textAlignleft|center|rightcenter-Text alignment within container

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

The Container component is ideal for grouping sections together and applying consistent styling across them. It's particularly useful for creating full-width backgrounds that span multiple sections.