Socket
Book a DemoInstallSign in
Socket

@ecomailcz/mjml-social

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ecomailcz/mjml-social

@ecomailcz/mjml-social

latest
Source
npmnpm
Version
4.4.0-ecm-28
Version published
Maintainers
2
Created
Source

mjml-social

desktop

Displays calls-to-action for various social networks with their associated logo. You can add social networks with the mj-social-element tag.

<mjml>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-social font-size="15px" icon-size="30px" mode="horizontal">
          <mj-social-element name="facebook" href="https://mjml.io/">
            Facebook
          </mj-social-element>
          <mj-social-element name="google" href="https://mjml.io/">
            Google
          </mj-social-element>
          <mj-social-element  name="twitter" href="https://mjml.io/">
            Twitter
          </mj-social-element>
        </mj-social>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

try it live

attributeunitdescriptiondefault value
alignstringleft/right/centercenter
border-radiuspxborder radius3px
colorcolortext color#333333
css-classstringclass name, added to the root HTML element createdn/a
container-background-colorcolorinner element background colorn/a
font-familystringfont nameUbuntu, Helvetica, Arial, sans-serif
font-sizepx/emfont size13px
font-stylestringfont stylenormal
font-weightstringfont weightnormal
icon-heightpercent/pxicon height, overrides icon-sizeicon-size
icon-sizepercent/pxicon size (width and height)20px
inner-paddingpxsocial network surrounding padding4px
line-heightpercent/pxspace between lines22px
modestringvertical/horizontalhorizontal
paddingpxsupports up to 4 parameters10px 25px
padding-bottompxbottom offsetn/a
padding-leftpxleft offsetn/a
padding-rightpxright offsetn/a
padding-toppxtop offsetn/a
icon-paddingpxpadding around the icons0px
text-paddingpxpadding around the texts4px 4px 4px 0
text-decorationstringunderline/overline/nonenone

mj-social-element

This component enables you to display a given social network inside mj-social.
Note that default icons are transparent, which allows background-color to actually be the icon color.

attributeunitdescriptiondefault value
alignstringleft/right/centercenter
altstringimage alt attributenone
background-colorcoloricon colorEach social name has its own default
border-radiuspxborder radius3px
colorcolortext color#333333
css-classstringclass name, added to the root HTML element createdn/a
font-familystringfont nameUbuntu, Helvetica, Arial, sans-serif
font-sizepx/emfont size13px
font-stylestringfont stylenormal
font-weightstringfont weightnormal
hrefurlbutton redirection url[[SHORT_PERMALINK]]
icon-heightpercent/pxicon height, overrides icon-sizeicon-size
icon-sizepercent/pxicon size (width and height)20px
line-heightpercent/pxspace between lines22px
modestringvertical/horizontalhorizontal
namestringsocial network name, see supported list belowN/A
paddingpxsupports up to 4 parameters10px 25px
padding-bottompxbottom offsetn/a
padding-leftpxleft offsetn/a
padding-rightpxright offsetn/a
padding-toppxtop offsetn/a
icon-paddingpxpadding around the icon0px
text-paddingpxpadding around the text4px 4px 4px 0
srcurlimage sourceEach social name has its own default
targetstringlink target_blank
titlestringimg title attributenone
text-decorationstringunderline/overline/nonenone

Supported networks with a share url:

  • facebook
  • twitter
  • google
  • pinterest
  • linkedin
  • tumblr
  • xing

Without a share url:

  • github
  • instagram
  • web
  • snapchat
  • youtube
  • vimeo
  • medium
  • soundcloud
  • dribbble

When using a network with share url, the href attribute will be inserted in the share url (i.e. https://www.facebook.com/sharer/sharer.php?u=[[URL]]). To keep your href unchanged, add -noshare to the network name. Example :

<mj-social-element name="twitter-noshare" href="my-unchanged-url">Twitter</mj-social-element>

Custom Social Element

You can add any unsupported network like this:

<mj-social-element href="url" background-color="#FF00FF" src="path-to-your-icon">
  Optional label
</mj-social-element>

FAQs

Package last updated on 27 May 2025

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