How to import svg.js

Hi guys! I’ve been scattering through this article for svg.js trying to find what syntax I needed to use to import svg.js, but I haven’t been able to. Does anyone know how to do this properly?

Thanks alot!

https://support.wix.com/en/article/information-and-guidelines-on-vector-art

For adding html into your website, you will need to open an html iframe on your page and enter the code into that.
https://support.wix.com/en/article/adding-html-code

I think you got the wrong idea. I’m trying to import a nodule package file called svg.js, not a svg image.

You can install svg.js from the Package Manager :

After that, do I just…use the code? Don’t I have to do something similar to “import” like in this example??


If so, how do I do it? And where does it say that I need to do it?

You should refer to the documentation of the svg.js package to see how it’s used.

I did, and this is what I found, I tried typing it in and it didn’t work. I assume that’s because Wix has a different way of importing stuffs.

@tgkhang262 You install svg.js using the Package Manager . To see how to use the package in your program, refer to the svg.js documentation .

So all I needed to do was just installing it using the package manager. There was nothing else that I had to do before I can start using the package. Right?

If so, I have one last question. What’s the equivalence of a

element in Wix? svg.js needs a
element to work in. Do I have to use an iframe to create the
element? Or is there an element in Wix that I can add in that will act similar to a
?

@tgkhang262 You use the VectorImage component for SVG images. You can set the .src property with your SVG code.

Opps, my bad, I saw svg and went with that instead of looking at the .js on the end to see that you meant using a node package manager instead. Anyways, happy to see that Yisrael as told you already so I don’t need to correct myself!

Also, in case you ever need to use another npm, here is a list of all the packages that have been requested for use in Wix and it tells you their current status for all of them too.
https://www.wix.com/corvid/reference/npm-modules.html

@tgkhang262 So were you able to get it to work? I am trying and so far unable to figure it out! - any, and I do mean any, help is very much appreciated!!!