How to create a custom block with fillable params
No community answers yet. Open the original discussion on GitHub to share your solution.
Question
Hi guys, first of all excellent work!
I tried following the tutorial but I am unable to understand how to add a custom block, to which after selecting it the user can fill in parameters (name and title for example) from the menu on the right.
I read about blocks, components and traits but I fail to understand how to write a new block (or component) myself.
Would someone be so kind to write me a very simple example? e.g. drag and drop a block that adds a <p>Hello world!</p> tag. After you click on it the user should be able to add classes, a title and fill in a value for a "data-name=''" property.
I hope someone can explain to me how its done, I am sure I will understand it after seeing a full code example.
Answers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2189
[Question] How to add "Ordered/Unordered List" option in rte/custom block
Hi I'm trying to create an ordered list with grapesjs. I tried adding the following to the rte: And this works if my page is pre-filled wit...
Issue #1588
[QUESTION]
Hi guys and thank you for your magnificent work and this API! I have a question about the box, which wraps all components after saving. For...
Issue #2144
[QUESTION] how to create custom element
Hi guys, I'm new in this so I'm sorry for my question. I'm trying to use grapesjs to edit email templates. Is it possible to have dynamic f...
Issue #6318
Unable to use transparent fill in Block media svg
GrapesJS version[X] I confirm to use the latest version of [email protected] when this issue was filedWhat browser are you using? Fir...
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
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Tutorial
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins — TinyMCE Inline Text Editor and Placeholder.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.