Add Setting button to custom component.
Hello,
How can I create a setting or you can say edit button for my custom component?
LIke 4th option on this image:

Hi @HarshOB,
It is simple as image does https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/ComponentImage.js#L32
Hello @ateshuseyin
I don't want the same editor as an image I want to build my own. I just want to add that icon to my component and when I click on that icon I want to display area through the user can add text, image, HTML code etc and that will be reflected in that component.
The above link I referenced before is only for adding button to toolbar. I think you should just follow below steps to complete your task;
- Create/Implement a editor according to your needs. grapesjs-aviary uses aviary editor (see)
- Define a command which is capable to open your editor like grapesjs-aviary see
- Define toolbar button as I referenced before which runs your command
Thats all.
@HarshOB Create your Component (or extend one) and add your toolbar buttons (as suggested by @ateshuseyin)
Hi @HarshOB,
It is simple as image does https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/ComponentImage.js#L32
Can you please guide me on how this can be incorporated in a grapesjs-preset-webpage, I am unable to get the desired result while using this code in my project.
@sakshigarg9 https://github.com/artf/grapesjs/issues/266#issuecomment-470329181
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.