How to use the mjml-button.allowedAttributes function in mjml-button

To help you get started, we’ve selected a few mjml-button examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github homerjam / mjml-mailchimp / src / mc-button.js View on Github external
import MjButton from 'mjml-button'
import { BodyComponent } from 'mjml-core'
import { registerDependencies } from 'mjml-validator'

  'mj-column': ['mc-button'],
  'mj-hero': ['mc-button'],
  'mc-button': [],

export default class McButton extends MjButton {
  static endingTag = true

  static allowedAttributes = {
    'mc:edit': 'string',
    'mc:hideable': 'string',

  static defaultAttributes = {
    'mc:hideable': false

  isHideable() {
    if (this.getAttribute('mc:hideable') !== false) {
      return true

    return false



Latest version published 6 months ago

Package Health Score

87 / 100
Full package analysis

Similar packages