npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yakoue/react-email-builder

v0.0.7

Published

Yakoue's MJML Drag & Drop email builder component for Reactjs

Downloads

2

Readme

Yakoue Email Editor

Yakoue Email builder

Install

CDN

<script src="https://unpkg.com/@yakoue/react-email-builder"></script>

NPM

$ npm install @yakoue/react-email-builder --save
or
$ yarn @yakoue/react-email-builder

component

import React, { useRef } from 'react';
import { render } from 'react-dom'

import EmailBuilder from '@yakoue/react-email-builder';

const App = (props) => {

  const exportHtml = () => {
   this.instance.export();
  };

  const onLoad = (instance) => {
      this.instance=instance
       this.instance.addEvent('onExport', (data) => {
        console.log('exportHtml', data)
      })

      this.instance.setTemplate(`<mjml> 
<mj-body> 
    <mj-section> 
        <mj-column> 
            <mj-text>
                <h1> Hey Title! </h1> 
            </mj-text>
                <mj-button> Hi nestor! </mj-button>
        </mj-column>
    </mj-section>  
</mj-body> 
</mjml>`)
  };

  return (
    <div>
      <div>
        <button onClick={exportHtml}>Export HTML</button>
      </div>
      
      <EmailBuilder
        onLoad={onLoad}
      />
    </div>
  );
};

render(<App />, document.getElementById('app'))

Methods

| Method | Param | description | | -------------------------|------------------------|----------------------------| | setTemplate | template | Take the template and load it to the builder | | saveTemplate | Function callback | Returns the design JSON and HTML in a callback function| | exportHtml | Function callback | Returns the design HTML in a callback function |

Properties

template object or string You can set MJML Json on MJML XML as string to this props

config object You can use this props to config and customize the builder

onLoad function callback You can use this to set call back function on builder load

Configuration Options


| Attribute | Required | | | :---------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- | | brandobject | No | This is the Brand Object from Yakoue. You can get it from the Brand settings page. | | localestring | No | This is the locale you want to load the editor in. We have many translations available. | | fusionTags object | No | This is an array of objects. You can pass the merge tags and special links to display in the editor. | | tokenstring | No | String token for authentication. It is required to enable user saved blocks. | | toolsobject | No | These are the options for tools and custom tools. | | blocksobject | No | This is an array of objects. You can pass custom blocks here. | | drowsobject | No | This is an array of objects. You can pass custom rows (sections) here. | | bodyobject | No | This objects to custom default template settings | | editor object | No | These are some editor options for different functions of the editor. | | fonts object | No | You can pass custom fonts here. | | toolsDefaultValuesobject | No | You can pass default tools properties here. | | callbacks array | No | Array of callbacks functions |

Customize configuration

See Configuration Reference.

For any report please write to [email protected]