# grapesjs-react

> React wrapper for GrapesJS

Latest version **4.0.3** (published 2025-09-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install grapesjs-react
pnpm add grapesjs-react
yarn add grapesjs-react
bun add grapesjs-react
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.0.3 |
| Published | 2025-09-21 |
| First published | 2018-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 197 |
| Author | thanhtunguet |
| Maintainers | thanhtunguet |

## Links

- npm: https://www.npmjs.com/package/grapesjs-react
- Repository: https://github.com/thanhtunguet/grapesjs-react
- Homepage: https://github.com/thanhtunguet/grapesjs-react#readme
- Issues: https://github.com/thanhtunguet/grapesjs-react/issues
- npm.io page: https://npm.io/package/grapesjs-react

## Recent versions

- 4.0.3 (latest) — 2025-09-21
- 4.0.2 — 2024-01-13
- 4.0.1 — 2022-08-17
- 4.0.1-alpha — 2021-04-16
- 3.1.3 — 2021-04-10
- 4.0.0-alpha — 2021-04-04
- 3.1.2 — 2021-03-20
- 3.1.1 — 2020-07-06
- 3.1.0 — 2020-07-06
- 3.0.4 — 2020-02-17
- 3.0.2 — 2020-02-05
- 3.0.1 — 2019-12-25
- 3.0.0 — 2019-12-13
- 2.0.2 — 2019-10-02
- 2.0.1 — 2019-10-02
- … 11 more at https://npm.io/package/grapesjs-react/versions

## README

grapesjs-react
==============
_A React wrapper library for [GrapesJS](https://grapesjs.com)_

[Online Demo](https://thanhtunguet.github.io/grapesjs-react)

## 📢 Project Maintenance Notice

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](https://github.com/GrapesJS/react)

## Installation

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

or

```shell
yarn add grapesjs grapesjs-react grapesjs-blocks-basic
```

## Usage

#### WebPage

You need to install the [grapesjs-preset-webpage](https://www.npmjs.com/package/grapesjs-preset-webpage) plugin

```tsx
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](https://www.npmjs.com/package/grapesjs-preset-newsletter) plugin

```tsx
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](https://www.npmjs.com/package/grapesjs-mjml) plugin

```tsx
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.

| Name | Desc | Type |
| -- | -- | -- |
| id | string | Editor container id |
| children | ReactNode[] | Children to init (using fromElement) |
| onInit | Function<Editor> | Function will be called after editor was initialized |
| onDestroy | Function<void> | 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*, ...

## Contribution

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

Pull requests are welcome.

&copy;2021 [thanhtunguet](https://thanhtunguet.github.io)

---
_Source: https://npm.io/package/grapesjs-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
