GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.4k stars 4.06k forks source link

[Question] Custom icons #1031

Closed francesca-cicileo closed 6 years ago

francesca-cicileo commented 6 years ago

I want to add a custom icon to the grapesjs panel at the top of the editor page. Is it possible to do this with any SVG or with text? If so, can you explain how? I've tried the following but couldn't get an icon to show:

var pnm = editor.Panels;
pnm.addButton('options', {
  label: '<svg ... </svg>',
 ...
});

I've also tried this to use text as an icon, but couldn't get that working either:

var pnm = editor.Panels;
pnm.addButton('options', {
  label: 'words',
  className: 'fa fa-text',
 ...
});

(I'm also using the newsletter plugin).

artf commented 6 years ago

At the moment, there is no label property on buttons so you can edit them only via className. BTW I like the idea, I'll make it available in the next release

lock[bot] commented 5 years ago

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.