Is it possible to create a component using react components?
Question
is it possible to create or get a react component from some library and insert as a allowed component for create a template?
import React from 'react';
import CustomButton from './components/CustomButton'
import grapesjs from 'grapesjs'
const editor = grapesjs.init({
...
});
editor.addComponents(<CustomButton color="red" otherProp={...somepros}/>);
//or
editor.BlockManager.add('CustomButton', {
label: 'button',
content: <CustomButton color="red" otherProp={...somepros}/>,
});
Answers (1)
@TRUEND here is an example Cheers!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #951
Selection of custom components not possible from canvas.
Hey, I tried to figure this out by myself, but I'm feeling I'm going a little bit in circles. So I hope you will have some time to read thi...
Issue #3727
Issue on Style Import
Hi @artf, Describe the bug detailed While creating a new template using GrapesJS, I came across a scenario that, when we try to import CSS...
Issue #3446
Cannot Store Data Unexpected token '-'
Please Help Me, I Want To Store gjs data to mysql but i cannot get any data from front end to back end here my code: const editor = grapesj...
Issue #3137
When I select an particular element I'm not getting its styles. This issue happens only with some elements.
Not getting styles of the selected element Here is my code, const model = editor.StyleManager.getModelToStyle(component); let styleObject =...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Tutorial
Introducing Search on GJS.Market
GJS.Market now has one search across everything we publish — plugins, articles, community questions, guides, authors and services. Press ⌘K from any page.
Tutorial
GJS.Market Is Now Available for India 🇮🇳
GJS.Market is expanding its global presence with a dedicated experience for developers, agencies, SaaS companies, and digital creators in India
Tutorial
How to Build an AI-Powered Page Builder with GrapesJS in 2026
What we learned building GJSDocs — from simple AI text generation to structured, context-aware visual editing
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.