Socket
Socket
Sign inDemoInstall

mjml-navbar

Package Overview
Dependencies
3
Maintainers
6
Versions
110
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mjml-navbar

mjml-navbar


Version published
Weekly downloads
572K
increased by2.5%
Maintainers
6
Created
Weekly downloads
 

Readme

Source

mj-navbar

example desktop width navbar

Displays a menu for navigation with an optional hamburger mode for mobile devices.

<mjml>
  <mj-body>
    <mj-section background-color="#ef6451">
      <mj-column>
        <mj-navbar base-url="https://mjml.io" hamburger="hamburger" ico-color="#ffffff">
            <mj-navbar-link href="/gettings-started-onboard" color="#ffffff">Getting started</mj-navbar-link>
            <mj-navbar-link href="/try-it-live" color="#ffffff">Try it live</mj-navbar-link>
            <mj-navbar-link href="/templates" color="#ffffff">Templates</mj-navbar-link>
            <mj-navbar-link href="/components" color="#ffffff">Components</mj-navbar-link>
        </mj-navbar>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

try it live

mj-navbar

Individual links of the menu should be wrapped inside mj-navbar.

Standard Desktop:

example desktop width navbar

Standard Mobile:

example mobile width navbar

Mode hamburger enabled:

hamburger mode animation shows menu expansion after clicking hamburger icon

The "hamburger" feature only work on mobile device with all iOS mail client, for others mail clients the render is performed on an normal way, the links are displayed inline and the hamburger is not visible. All the attributes prefixed with ico- help to customize the hamburger icon. They only work with the hamburger mode enabled.
attributeunitdescriptiondefault value
alignstringalign content left/center/rightcenter
base urlstringbase url for children componentsn/a
css-classstringclass name, added to the root HTML element createdn/a
hamburgerstringactivate the hamburger navigation on mobile if the value is hamburgern/a
ico-alignstringhamburger icon alignment, left/center/right (hamburger mode required)center
ico-closeASCII code decimalchar code for a custom close icon (hamburger mode required)8855
ico-colorcolor formathamburger icon color (hamburger mode required)#000000
ico-font-familystringhamburger icon font (only on hamburger mode)Ubuntu, Helvetica, Arial, sans-serif
ico-font-sizepxhamburger icon size (hamburger mode required)30px
ico-line-heightpxhamburger icon line height (hamburger mode required)30px
ico-openASCII code decimalchar code for a custom open icon (hamburger mode required)9776
ico-paddingpxhamburger icon padding, supports up to 4 parameters (hamburger mode required)10px
ico-padding-bottompxhamburger icon bottom offset (hamburger mode required)10px
ico-padding-leftpxhamburger icon left offset (hamburger mode required)10px
ico-padding-rightpxhamburger icon right offset (hamburger mode required)10px
ico-padding-toppxhamburger icon top offset (hamburger mode required)10px
ico-text-decorationstringhamburger icon text decoration none/underline/overline/line-through (hamburger mode required)none
ico-text-transformstringhamburger icon text transformation none/capitalize/uppercase/lowercase (hamburger mode required)none

This component should be used to display an individual link in the navbar.

The mj-navbar-link component must be used inside a mj-navbar component only. `mj-navbar-link` is an "ending tag", which means it can contain HTML code which will be left as it is, so it can contain HTML tags with attributes, but it cannot contain other MJML components. More information about ending tags in this section.
attributeunitdescriptiondefault value
colorcolortext color#000000
css-classstringclass name, added to the root HTML element createdn/a
font-familystringfontUbuntu, Helvetica, Arial, sans-serif
font-sizepxtext size13px
font-stylestringnormal/italic/obliquen/a
font-weightnumbertext thicknessn/a
hrefstringlink to redirect to on clickn/a
letter-spacingpx,emletter-spacingn/a
line-heightpxspace between the lines22px
paddingpxsupports up to 4 parameters15px 10px
padding-bottompxbottom offsetn/a
padding-leftpxleft offsetn/a
padding-rightpxright offsetn/a
padding-toppxtop offsetn/a
relstringspecify the rel attributen/a
targetstringlink target on clickn/a
text-decorationstringunderline/overline/nonen/a
text-transformstringcapitalize/uppercase/lowercase/noneuppercase

FAQs

Last updated on 05 Feb 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc