@labor-digital/mjml-components

1.11.8 • Public • Published

LABOR - MJML Components

This package contains a number of custom mjml components.

Installation

Install this package using npm:

npm install @labor-digital/mjml-components

Currently this package only supports MJML 4.6.*.

Setup

Before using the components they need to be registered. This can be done by adding the following code to a gulp task.

Register specific components

import { registerComponent } from 'mjml-core'
import { LaborResponsiveImage, LaborRoundedButton } from '@labor-digital/mjml-components'

const registerComponents = () => {
  registerComponent(LaborResponsiveImage)
  registerComponent(LaborRoundedButton)
}

exports.build = gulp.series(
  (cb) => {
    registerExternalComponents()
    return cb()
  },
  // do other stuff
)

Register all available components

import { registerComponent } from 'mjml-core'
import * as Components from '@labor-digital/mjml-components'

const registerExternalComponents = () => {
  Object.values(Components)
    .filter((c) => c !== undefined)
    .forEach((component) => registerComponent(component))
}

exports.build = gulp.series(
  (cb) => {
    registerExternalComponents()
    return cb()
  },
  // do other stuff
)

Documentation

Will be available in the future.

Readme

Keywords

none

Package Sidebar

Install

npm i @labor-digital/mjml-components

Weekly Downloads

0

Version

1.11.8

License

Apache-2.0

Unpacked Size

281 kB

Total Files

57

Last publish

Collaborators

  • labor-digital