4.0.2 • Published 3 months ago

grapesjs-react v4.0.2

Weekly downloads
801
License
MIT
Repository
github
Last release
3 months ago

grapesjs-react

A React wrapper library for GrapesJS

Online Demo

Installation

npm i -S grapesjs grapesjs-react grapesjs-blocks-basic

or

yarn add grapesjs grapesjs-react grapesjs-blocks-basic

Usage

WebPage

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
    ]}
  />;
};

Newsletter

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
    ]}
  />;
};

MJML

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
    ]}
  />;
};

Props detail

Editor's props extends the base GrapesJS editor options.

NameDescType
idstringEditor container id
childrenReactNode[]Children to init (using fromElement)
onInitFunctionFunction will be called after editor was initialized
onDestroyFunctionFunction 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, ...

Contribution

If you find a bug or need any help, please create an issue.

Pull requests are welcome.

©2021 thanhtunguet

4.0.2

3 months ago

4.0.1

2 years ago

4.0.1-alpha

3 years ago

3.1.3

3 years ago

4.0.0-alpha

3 years ago

3.1.2

3 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.4

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.0

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago