-
I would like to add a block for headings that allows the user to select the actual tag (h1, h2...). Is it possible to create a component that changes it's own tag on property or attribute change? Basically drop a "heading" component on the canvas and then allow the user to select h1, h2, etc from a selection attribute/property. Once selected, it will actually use the selected tag. I have looked into creating a custom tag tag with an attribute , then using the view to render the actual h2 tag. It gets complicated when I am wanting to do a getHtml() or if I want to apply style/classes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Check this plugin https://github.com/olivmonnier/grapesjs-plugin-header it uses the old API but the concept for traits it's the same |
Beta Was this translation helpful? Give feedback.
Check this plugin https://github.com/olivmonnier/grapesjs-plugin-header it uses the old API but the concept for traits it's the same