Installations
npm install react-email-editor
Score
95.5
Supply Chain
97.9
Quality
81.1
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
>=10
Typescript Support
No
Node Version
16.13.0
NPM Version
8.1.0
Statistics
4,633 Stars
193 Commits
744 Forks
52 Watching
8 Branches
12 Contributors
Updated on 29 Nov 2024
Languages
TypeScript (90.28%)
JavaScript (9.72%)
Total Downloads
Cumulative downloads
Total Downloads
5,530,283
Last day
-9.7%
8,047
Compared to previous day
Last week
9.3%
47,725
Compared to previous week
Last month
2.1%
186,389
Compared to previous month
Last year
71.7%
2,513,849
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Peer Dependencies
1
React Email Editor
The excellent drag-n-drop email editor by Unlayer as a React.js wrapper component. This is the most powerful and developer friendly visual email builder for your app.
Video Overview |
---|
Watch video overview: https://youtu.be/MIWhX-NF3j8 |
Live Demo
Check out the live demo here: https://react-email-editor-demo.netlify.app/ (Source Code)
Blog Post
Here's a blog post with a quickstart guide: https://medium.com/unlayer-blog/creating-a-drag-n-drop-email-editor-with-react-db1e9eb42386
Installation
The easiest way to use React Email Editor is to install it from NPM and include it in your own React build process.
npm install react-email-editor --save
Usage
Require the EmailEditor component and render it with JSX:
1import React, { useRef } from 'react'; 2import { render } from 'react-dom'; 3 4import EmailEditor, { EditorRef, EmailEditorProps } from 'react-email-editor'; 5 6const App = (props) => { 7 const emailEditorRef = useRef<EditorRef>(null); 8 9 const exportHtml = () => { 10 const unlayer = emailEditorRef.current?.editor; 11 12 unlayer?.exportHtml((data) => { 13 const { design, html } = data; 14 console.log('exportHtml', html); 15 }); 16 }; 17 18 const onReady: EmailEditorProps['onReady'] = (unlayer) => { 19 // editor is ready 20 // you can load your template here; 21 // the design json can be obtained by calling 22 // unlayer.loadDesign(callback) or unlayer.exportHtml(callback) 23 24 // const templateJson = { DESIGN JSON GOES HERE }; 25 // unlayer.loadDesign(templateJson); 26 }; 27 28 return ( 29 <div> 30 <div> 31 <button onClick={exportHtml}>Export HTML</button> 32 </div> 33 34 <EmailEditor ref={emailEditorRef} onReady={onReady} /> 35 </div> 36 ); 37}; 38 39render(<App />, document.getElementById('app'));
See the example source for a reference implementation.
Methods
All unlayer methods are available in the editor instance (emailEditorRef.current.editor
). See the Unlayer Docs for more information, or log the object in the console to explore it. Here are the most used ones:
method | params | description |
---|---|---|
loadDesign | Object data | Takes the design JSON and loads it in the editor |
saveDesign | Function callback | Returns the design JSON in a callback function |
exportHtml | Function callback | Returns the design HTML and JSON in a callback function |
Properties
editorId
{String
} HTML div id of the container where the editor will be embedded (optional)minHeight
{String
} minimum height to initialize the editor with (default 500px)onLoad
{Function
} called when the editor instance is createdonReady
{Function
} called when the editor has finished loadingoptions
{Object
} options passed to the Unlayer editor instance (default {})- See the Unlayer Docs for all available options.
style
{Object
} style object for the editor container (default {})
Custom Tools
Custom tools can help you add your own content blocks to the editor. Every application is different and needs different tools to reach it's full potential. Learn More
Localization
You can submit new language translations by creating a PR on this GitHub repo: https://github.com/unlayer/translations. Translations managed by PhraseApp
License
Copyright (c) 2024 Unlayer. MIT Licensed.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
branch protection is not maximal on development and all release branches
Details
- Info: 'allow deletion' disabled on branch 'master'
- Info: 'force pushes' disabled on branch 'master'
- Warn: 'branch protection settings apply to administrators' is disabled on branch 'master'
- Warn: 'stale review dismissal' is disabled on branch 'master'
- Warn: required approving review count is 1 on branch 'master'
- Warn: codeowners review is not required on branch 'master'
- Warn: 'last push approval' is disabled on branch 'master'
- Warn: no status checks found to merge onto branch 'master'
- Info: PRs are required in order to make changes on branch 'master'
Reason
Found 5/18 approved changesets -- score normalized to 2
Reason
2 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 2
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 19 are checked with a SAST tool
Reason
36 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj
- Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-876r-hj45-fw7g
- Warn: Project is vulnerable to: GHSA-v63x-xc9j-hhvq
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-w5q7-3pr9-x44w
- Warn: Project is vulnerable to: GHSA-3fjq-93xj-3f3f
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
Score
2.9
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to react-email-editor
@types/react-email-editor
TypeScript definitions for react-email-editor
md-to-react-email
A simple Markdown to jsx parser for email templates written in typescript.
react-email
A live preview of your emails right in your browser.
@react-email/render
Transform React components into HTML email templates