Issue #1841✓ SolvedOpened February 28, 2019by minuwan3 reactions

Components name

Quick answerby NicoEngler2

You can use data-gjs-custom-name on your components html. <h1 data-gjs-custom-name="Your Name" ...>You can use data-gjs-icon on your components html. <h1 data-gjs-icon='<i class="fa fa-arrows"></i>' ...> Please change your title to something more meaningful so others can find already solved problems better :) EDIT: yo...

Read full answer below ↓

Question

I have two questions.

  1. Is there any way to change the built-in components name? I wanted to change the name "Box" to "Div". so the same name appears on select and on the layers/navigator panel. In simple term, if I drag and dropped a div, I need it to be named Div.

  2. Any way to add an icon in front of the text of each item type in the layers panel? I mean a box for Div, A list icon for ULs etc...

Answers (3)

👍 Most helpfulNicoEnglerFebruary 28, 2019

You can use data-gjs-custom-name on your components html. <h1 data-gjs-custom-name="Your Name" ...>You can use data-gjs-icon on your components html. <h1 data-gjs-icon='<i class="fa fa-arrows"></i>' ...> Please change your title to something more meaningful so others can find already solved problem...

artfMarch 3, 2019

I'd add that if you rely on HTML5 drag & drop, you can use canvas:dragdata event https://grapesjs.com/docs/api/editor.html#available-events This allows you to make the editor understand "external drops", eg. by default GrapesJS can recognize images, by using canvas:dragdata you can make it recogniz...

minuwanFebruary 28, 2019

@NicoEngler Any other way to set default custom names for each type? If someone drag and drop content from outside, I want to display those div's names as "Divs" as well. :)

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

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.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.