svg2all

Convert SVG to Vue component

Turns an SVG into a ready-to-import Vue component – in your browser, no upload.

Runs in your browser – your file is never uploaded

Loading tool …

Frequently asked questions

Is my file uploaded?

No. The conversion runs entirely in your browser. The file never leaves your device – there is no server that could see it. Once the page has loaded, the tool even works offline.

How do I use the component?

Save the file next to your code and import it: import MyIcon from "./MyIcon.vue"; Everything you pass to the component goes to the <svg> element, so <MyIcon class="h-6 w-6" aria-hidden="true" /> works as expected. The component is named after the file, in PascalCase.

What is changed in the SVG?

The markup stays plain SVG inside a <template>; only the XML prolog, comments and DOCTYPE are removed. Attributes set on the component fall through to the root element via v-bind="$attrs". Unless you switch off “Optimise first”, the SVG is also run through the same optimiser as “Optimise SVG”, which shortens the code noticeably.

What about scripts and external references?

Scripts, event handlers, external images and style sheets are removed before the component is generated – you never ship untrusted code by accident.