
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
grapesjs-react
Advanced tools
A React wrapper library for GrapesJS
I originally built this library in 2018 during my internship at Teko Vietnam, when GrapesJS was still new and didn’t yet have a React wrapper. To my surprise, it grew to over 200 stars on GitHub and helped developers around the world get their work done. Now that GrapesJS offers its own official React library, it feels like the right time to retire this project. Thank you all for your support!
You can visit Grapesjs's official library here: https://github.com/GrapesJS/react
npm i -S grapesjs grapesjs-react grapesjs-blocks-basic
or
yarn add grapesjs grapesjs-react grapesjs-blocks-basic
You need to install the grapesjs-preset-webpage plugin
import 'grapesjs/dist/css/grapes.min.css';
import gjspresetwebpage from 'grapesjs-preset-webpage';
import gjsblockbasic from 'grapesjs-blocks-basic'
export const Primary = () => {
return <GrapesjsReact
id='grapesjs-react'
plugins={[
gjspresetwebpage,
gjsblockbasic
]}
/>;
};
You need to install the grapesjs-preset-newsletter plugin
import 'grapesjs/dist/css/grapes.min.css';
import gjsblockbasic from 'grapesjs-blocks-basic'
import gjspresetnewsletter from 'grapesjs-preset-newsletter';
export const Newsletter = () => {
return <GrapesjsReact
id='grapesjs-react'
plugins={[
gjsblockbasic,
gjspresetnewsletter
]}
/>;
};
You need to install the grapesjs-mjml plugin
import 'grapesjs/dist/css/grapes.min.css';
import gjsblockbasic from 'grapesjs-blocks-basic'
import gjsmjml from 'grapesjs-mjml';
export const MJML = () => {
return <GrapesjsReact
id='grapesjs-react'
plugins={[
gjsblockbasic,
gjsmjml
]}
/>;
};
Editor's props extends the base GrapesJS editor options.
| Name | Desc | Type |
|---|---|---|
| id | string | Editor container id |
| children | ReactNode[] | Children to init (using fromElement) |
| onInit | Function | Function will be called after editor was initialized |
| onDestroy | Function | Function will be called when editor unmounted |
The rest props will be passed as options to initialize editor. You can use any options of grapesjs like plugins, blockManager, styleManager, storageManager, ...
If you find a bug or need any help, please create an issue.
Pull requests are welcome.
©2021 thanhtunguet
FAQs
React wrapper for GrapesJS
The npm package grapesjs-react receives a total of 2,624 weekly downloads. As such, grapesjs-react popularity was classified as popular.
We found that grapesjs-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.