New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

mjml-hero

Package Overview
Dependencies
Maintainers
7
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-hero

mjml-hero

latest
Source
npmnpm
Version
5.0.1
Version published
Weekly downloads
1.3M
16.48%
Maintainers
7
Weekly downloads
 
Created
Source

mj-hero

Displays a hero image and behaves like an mj-section tag with a single mj-column tag.

The background-height and background-width attributes are mandatory and it's best to use an image with width the same as the mj-body (width="600px" by default) and height the same or larger than the height of mj-hero.

Use background-color to provide a fallback color in case an email client doesn't support background-url.

Note

The height attribute is only required for mode="fixed-height".

Fixed height demo background picture with fixed height
<mjml>
  <mj-body>
    <mj-hero
      mode="fixed-height"
      height="469px"
      background-width="600px"
      background-height="469px"
      background-url=
          "https://static.mailjet.com/mjml-website/documentation/hero.jpg"
      background-color="#2a3448"
      padding="100px 0px">
      <mj-text
        padding="20px"
        color="#ffffff"
        font-family="Helvetica"
        align="center"
        font-size="45px"
        line-height="45px"
        font-weight="900">
        GO TO SPACE
      </mj-text>
      <mj-button href="https://mjml.io/" align="center">
        ORDER YOUR TICKET NOW
      </mj-button>
    </mj-hero>
  </mj-body>
</mjml>
Fluid height demo background picture with fixed height
<mjml>
  <mj-body>
    <mj-hero
      mode="fluid-height"
      background-width="600px"
      background-height="469px"
      background-url=
          "https://static.mailjet.com/mjml-website/documentation/hero.jpg"
      background-color="#2a3448"
      padding="100px 0px">
      <mj-text
        padding="20px"
        color="#ffffff"
        font-family="Helvetica"
        align="center"
        font-size="45px"
        line-height="45px"
        font-weight="900">
        GO TO SPACE
      </mj-text>
      <mj-button href="https://mjml.io/" align="center">
        ORDER YOUR TICKET NOW
      </mj-button>
    </mj-hero>
  </mj-body>
</mjml>

Attributes

attributeacceptsdescriptiondefault value
background-colorCSS color formatshero background color#ffffff
background-heightpx %height of the image used, mandatory
background-positionstringCSS values, i.e. left center right + top center bottomcenter center
background-urlstringabsolute background in URL formatnull
background-widthpx %width of the image used, mandatoryinherits parent element width
border-radiusstringborder radius
css-classstringclass name, added to the root HTML element created
heightpx %hero section height, (required for fixed-height mode)0px
inner-background-colorCSS color formatscontent background color
inner-paddingpx %hero inner padding, supports up to 4 parameters
inner-padding-bottompx %hero bottom inner padding
inner-padding-leftpx %hero left inner padding
inner-padding-rightpx %hero right inner padding
inner-padding-toppx %hero top inner padding
modestringfluid-height or fixed-heightfluid-height
paddingpx %hero padding, supports up to 4 parameters0px
padding-bottompx %hero bottom paddingnull
padding-leftpx %hero left paddingnull
padding-rightpx %hero right paddingnull
padding-toppx %hero top paddingnull
vertical-aligntop middle bottomcontent vertical alignmenttop
  • Fixed height:
    Try it live
  • Fluid height:
    Try it live

FAQs

Package last updated on 16 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts