SVG is not visible in editor
Hello @Lighost I think the issue is with that svg because this is the only that isn't working properly. This can have some code that are not being understood properly by the Custom Block itself. One solution is to save the svg locally and drop it using the default Image Block of the editor, I have tested it and it wor...
Read full answer below ↓Question
Hello, I have needed to put svg into my project so I used custom code component for this purpose. But when I copy svg content into component it shows nothing. But when I look at generated index the svg is visible. I have tried same thing in demo editor, but there it is not visible in editor and also at preview mode. I have tested it with latest Safari and latest version of Google Chrome and of course I am using latest version of GrapesJS (0.16.12).
Source of wanted svg is HERE
How it looks in editor:

How it looks in index.html (in my page)

Firstly I thought mistake might be with my svg, but then it wouldn't be visible in index. Any idea what's wrong?
Answers (2)
Hello @Lighost I think the issue is with that svg because this is the only that isn't working properly. This can have some code that are not being understood properly by the Custom Block itself. One solution is to save the svg locally and drop it using the default Image Block of the editor, I have tested it and it works. Also I have tested the same issue with lot's of different svg's and they are working fine.
@RJCAM Yes I know, I have already did this, like inserted SVG as img. But in my case I really need insert it as svg object – because I have to do some hover effects with fill attribute. In any case, somehow it has started be visible in editor. I don't know what I have done, because I just like 3 times changed svg class filling, and now they are visible at editor. So for me, im closing this issue, because it's solved 😄 .
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2961
BUG: Components in custom modal isn't editable
Hello, I'm trying to add custom modal block to my project and I want to change content of this modal also with drag&drop. Here's code of my...
Issue #5037
How to drag external text into particular index inside the textable component?
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link NA Describe...
Issue #3342
jQuery not working for script in component
Hi! I have tried adding jquery in canvas as well as in index.html I am adding it in canvas like this- canvas = editor.Canvas; const script1...
Issue #2916
[Bug]: Text component content not retrieved properly when using custom RTE
Version: 0.16.12 Are you able to reproduce the bug from the demo ? [ ] Yes [x] No (it does not include a custom RTE) What is the expected b...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.