Skip to content

Commit eaed89a

Browse files
authored
react-renderer blog (#29)
1 parent e7acbdb commit eaed89a

File tree

2 files changed

+177
-0
lines changed

2 files changed

+177
-0
lines changed
50.7 KB
Loading
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: "Studio SDK Now Supports React Rendering: Visual Editing with Your Own Components"
3+
excerpt: "Swap out the default canvas and bring React into the heart of Studio SDK with the new React Renderer plugin—ideal for SSR, component-based design systems, and modern UI workflows."
4+
coverImage: "/assets/blog/react/renderer-react-plugin-screen.webp"
5+
date: "2025-07-10T18:00:00Z"
6+
author:
7+
name: Griffin
8+
ogImage:
9+
url: "/assets/blog/react/renderer-react-plugin-screen.webp"
10+
---
11+
12+
## React Rendering Comes to Studio SDK ⚛️
13+
14+
We’re thrilled to announce a powerful new addition to the [Studio SDK plugin ecosystem](https://app.grapesjs.com/docs-sdk/plugins/overview): the [React Renderer plugin](https://app.grapesjs.com/docs-sdk/plugins/custom-renderer/react).
15+
16+
This marks a major milestone for developers building component-driven applications and wanting visual editing capabilities that speak the same language as their frontends.
17+
18+
Whether you're running Next.js or shipping a custom component library, Studio SDK now gives you **direct visual editing of React components**.
19+
20+
---
21+
22+
## What This Unlocks
23+
24+
The new [react renderer plugin](https://app.grapesjs.com/docs-sdk/plugins/custom-renderer/react) allows you to:
25+
26+
- 🔁 **Replace the default HTML canvas with a React renderer**
27+
- 🧱 **Use your own React components inside the editor**
28+
- ✍️ **Add Pages and Blocks using JSX or HTML, auto-parsed into React elements**
29+
- 🖥️ **Render entire saved projects with a React component—even with SSR**
30+
31+
This isn’t just a minor enhancement. It’s a **paradigm shift** for how Grapes JS, both our studio and OS offering, integrates into modern app stacks.
32+
33+
---
34+
35+
## Why React Rendering?
36+
37+
Component-based frameworks are the default for modern web UIs. Until now, visual editing platforms struggled to cleanly support those workflows.
38+
39+
With the React Renderer plugin, your React components can now be used in Grapes Studio, but also installed as a plugin into the Open Source version of GrapesJS:
40+
41+
- Use props, slots, and events natively
42+
- Preserve styling and interactivity
43+
- Maintain one codebase across design and production
44+
45+
This means you can finally bridge the gap between **developer-authored components** and **user-generated content**—without losing structure, performance, or flexibility.
46+
47+
---
48+
49+
## How It Works
50+
51+
Here’s a quick overview of how to get started.
52+
53+
Import the plugin:
54+
55+
```js
56+
57+
import StudioEditor from '@grapesjs/studio-sdk/react';
58+
import '@grapesjs/studio-sdk/style';
59+
60+
// Import React renderer plugin
61+
import rendererReact from '@grapesjs/studio-sdk-plugins/dist/rendererReact';
62+
63+
```
64+
65+
Now you can define your components:
66+
67+
```js
68+
const reactRendererConfig = {
69+
components: {
70+
Hero: {
71+
component: Hero,
72+
props: () => [
73+
{
74+
type: 'text',
75+
name: 'title',
76+
label: 'Title'
77+
},
78+
{
79+
type: 'text',
80+
name: 'subtitle',
81+
label: 'Subtitle',
82+
value: 'Default Subtitle'
83+
}
84+
],
85+
},
86+
}
87+
};
88+
```
89+
90+
Now initalize the editor:
91+
92+
```js
93+
<StudioEditor
94+
options={{
95+
plugins: [
96+
rendererReact.init(reactRendererConfig),
97+
(editor) => {
98+
editor.Blocks.add('feature', {
99+
label: 'Feature component',
100+
category: 'React',
101+
full: true,
102+
content: <Feature title="Feature title" description="Feature description" />
103+
}, { at: 0 });
104+
}
105+
],
106+
project: {
107+
type: 'react',
108+
default: {
109+
pages: [
110+
{
111+
name: 'Page from React',
112+
component: (
113+
<>
114+
<Hero title="Build Visually with React" subtitle="A seamless editing experience using your components"/>
115+
<Section>
116+
<h2 data-gjs-type="heading" style={{ textAlign: 'center', fontSize: '2rem' }}>Features</h2>
117+
<Feature title="Modular Components" description="Build and edit with reusable UI blocks." />
118+
<Feature title="HTML to React" description="Convert legacy HTML into structured React." />
119+
<Button label="Get Started" href="#start" />
120+
</Section>
121+
</>
122+
)
123+
},
124+
{
125+
name: 'Page from HTML',
126+
component: `
127+
<h1>React Components from HTML</h1>
128+
<div data-gjs-type="Hero" title="React from HTML"></div>
129+
<style>
130+
body { font-family: system-ui; }
131+
</style>
132+
`
133+
}
134+
]
135+
}
136+
},
137+
}}
138+
/>
139+
```
140+
141+
## Ideal Use Cases
142+
143+
This plugin is perfect for teams that:
144+
145+
- Are building **custom design systems** or **white-labeled page builders**
146+
- Want to **re-use production React components** in a WYSIWYG context
147+
- Need **server-side rendering (SSR)** for React content
148+
- Are replacing legacy CMS editors with **dynamic React-based editing**
149+
- Want to provide **live previews** of marketing components, modals, or dashboards
150+
151+
No more exporting HTML and trying to parse it back into components. Now, your content pipeline stays **React-native from start to finish**.
152+
153+
---
154+
155+
## SSR, Frameworks, and Flexibility
156+
157+
The React Renderer supports both **client-side rendering** and **server-side rendering**, making it ideal for Next.js, Remix, or other SSR-first frameworks.
158+
159+
Projects can be saved as JSON and later rendered wherever needed—landing pages, email previews, admin dashboards—using your **actual app components**.
160+
161+
---
162+
163+
## Final Thoughts
164+
165+
This is a major step forward for Studio SDK, especially for teams who live in React. With this new plugin:
166+
167+
- You get full visual editing of your **own** components
168+
- You can render pages anywhere using **structured, component-safe data**
169+
- You can create smarter, more maintainable editors without duplication
170+
171+
It's visual editing, the React way.
172+
173+
⚛️ [Explore the React Renderer Plugin Docs](https://app.grapesjs.com/docs-sdk/plugins/custom-renderer/react)
174+
175+
176+
🍇 **Happy Building!**
177+

0 commit comments

Comments
 (0)