grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

How to use SVG

Open suchithmahadi opened this issue 9 years ago • 4 comments

I want to use a SVG component in a block how to use the SVG, If i create a Block using Component&JS, by default div tag comes. Need help.

suchithmahadi avatar Sep 18 '17 12:09 suchithmahadi

You should be able to put them directly within a Block

editor.BlockManager.add('svg-block', {
    label:'SVG BLOCK', 
    content:`<svg ...>...</svg>`
})

artf avatar Sep 19 '17 11:09 artf

Thanks for the Help, One quick question, Can we use javascript within the content of SVG block explained above , i wanted to try using Components&JS with SVG. Appreciate your work.

suchithmahadi avatar Sep 19 '17 11:09 suchithmahadi

Yeah, you should be able to do so by using a new Component Type or even directly within a block as explained in Components&JS

artf avatar Sep 19 '17 12:09 artf

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.

lock[bot] avatar Sep 18 '19 12:09 lock[bot]