Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mjml-accordion

Package Overview
Dependencies
Maintainers
6
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-accordion

mjml-accordion

  • 5.0.0-alpha.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

mj-accordion

accordion

mj-accordion is an interactive MJML component to stack content in tabs, so the information is collapsed and only the titles are visible. Readers can interact by clicking on the tabs to reveal the content, providing a great experience on mobile devices where space is scarce.

`mj-accordion-text` and `mj-accordion-title` are "ending tags", which means they can contain HTML code which will be left as it is, so they can contain HTML tags with attributes, but they cannot contain other MJML components. More information about ending tags in this section.
<mjml>
  <mj-head>
    <mj-attributes>
      <mj-accordion border="none" padding="1px" />
      <mj-accordion-element icon-wrapped-url="https://i.imgur.com/Xvw0vjq.png" icon-unwrapped-url="https://i.imgur.com/KKHenWa.png" icon-height="24px" icon-width="24px" />
      <mj-accordion-title font-family="Roboto, Open Sans, Helvetica, Arial, sans-serif" background-color="#fff" color="#031017" padding="15px" font-size="18px" />
      <mj-accordion-text font-family="Open Sans, Helvetica, Arial, sans-serif" background-color="#fafafa" padding="15px" color="#505050" font-size="14px" />
    </mj-attributes>
  </mj-head>

  <mj-body>
    <mj-section padding="20px" background-color="#ffffff">
      <mj-column background-color="#dededd">
        <mj-accordion>
          <mj-accordion-element>
            <mj-accordion-title>Why use an accordion?</mj-accordion-title>
            <mj-accordion-text>
              <span style="line-height:20px">
                Because emails with a lot of content are most of the time a very bad experience on mobile, mj-accordion comes handy when you want to deliver a lot of information in a concise way.
              </span>
            </mj-accordion-text>
          </mj-accordion-element>
          <mj-accordion-element>
            <mj-accordion-title>How it works</mj-accordion-title>
            <mj-accordion-text>
              <span style="line-height:20px">
                Content is stacked into tabs and users can expand them at will. If responsive styles are not supported (mostly on desktop clients), tabs are then expanded and your content is readable at once.
              </span>
            </mj-accordion-text>
          </mj-accordion-element>
        </mj-accordion>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

sexy

attributeunitdescriptiondefault value
borderstringCSS border format2px solid black
container-background-colorn/abackground-color of the celln/a
css-classstringclass name, added to the root HTML element createdn/a
font-familyn/afontUbuntu, Helvetica, Arial, sans-serif
icon-alignn/aicon alignmentmiddle
icon-heightpxicon width32px
icon-positionn/adisplay icon left or rightright
icon-unwrapped-altn/aalt text when accordion is unwrapped-
icon-unwrapped-urln/aicon when accordion is unwrappedhttps://i.imgur.com/w4uTygT.png
icon-widthpxicon height32px
icon-wrapped-altn/aalt text when accordion is wrapped+
icon-wrapped-urln/aicon when accordion is wrappedhttps://i.imgur.com/bIXv1bk.png
paddingpxpadding10px 25px
padding-bottompxpadding bottomn/a
padding-leftpxpadding leftn/a
padding-rightpxpadding rightn/a
padding-toppxpadding topn/a

mj-accordion-element

Creates an accordion title/text pair. An accordion can have any number of these pairs.

Inheritance applies between attributes supported in both `mj-accordion` and `mj-accordion-element` unless `mj-accordion-element` overrides.
attributeunitdescriptiondefault value
background-colorn/abackground colorn/a
bordern/aborderaffects each horizontal border in the accordion except the top one
css-classstringclass name, added to the root HTML element createdn/a
font-familyn/afontUbuntu, Helvetica, Arial, sans-serif
icon-alignn/aicon alignmentmiddle
icon-heightn/aicon width32px
icon-positionn/adisplay icon left or rightright
icon-unwrapped-altn/aalt text when accordion is unwrapped-
icon-unwrapped-urln/aicon when accordion is unwrappedhttps://i.imgur.com/w4uTygT.png
icon-widthn/aicon height32px
icon-wrapped-altn/aalt text when accordion is wrapped+
icon-wrapped-urln/aicon when accordion is wrappedhttps://i.imgur.com/bIXv1bk.png

mj-accordion-title

The title in a title/text pair.

attributeunitdescriptiondefault value
background-colorn/abackground colorn/a
colorn/atext colorn/a
css-classstringclass name, added to the root HTML element createdn/a
font-familyn/afont familyUbuntu, Helvetica, Arial, sans-serif
font-sizepxfont size13px
paddingpxpadding16px
padding-bottompxpadding bottomn/a
padding-leftpxpadding leftn/a
padding-rightpxpadding rightn/a
padding-toppxpadding topn/a

mj-accordion-text

The text in a title/text pair.

attributeunitdescriptiondefault value
background-colorn/abackground colorn/a
colorn/atext colorn/a
css-classstringclass name, added to the root HTML element createdn/a
font-familyn/afont familyUbuntu, Helvetica, Arial, sans-serif
font-sizepxfont size13px
font-weightnumbertext thicknessn/a
letter-spacingpx,emletter spacingnone
line-heightpxspace between the lines1
paddingpxpadding16px
padding-bottompxpadding bottomn/a
padding-leftpxpadding leftn/a
padding-rightpxpadding rightn/a
padding-toppxpadding topn/a

FAQs

Package last updated on 14 May 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc