Extension to improve working with SVGs on Visual Studio Code

.svg file to get a powerful editor with a live preview side-by-side.currentColor value to test your icons with different theme colors.Better SVG isn’t just for .svg files. It understands SVG syntax inside a wide range of modern web frameworks:
.svg, .xml.jsx, .tsx.vue.astro.svelteThe extension automatically detects SVG tags within these files, providing gutter icons, hover previews, and framework-aware optimization.
Integrated SVGO power allows you to shrink your SVGs without leaving the editor.
When optimizing inline SVGs (like in React or Vue), Better SVG:
v-if, on:click, className).{...props}).Customize your workflow through Settings → Extensions → Better SVG:
| Setting | Type | Default | Description |
|---|---|---|---|
betterSvg.autoReveal |
boolean |
true |
Automatically reveal and expand the SVG Preview panel in Explorer when opening SVG files. |
betterSvg.autoCollapse |
boolean |
true |
Automatically collapse the SVG Preview panel when no SVG files are active. |
betterSvg.enableHover |
boolean |
true |
Enable the hover preview when mouse is over SVG code. |
betterSvg.showGutterPreview |
boolean |
true |
Show small preview icons next to line numbers in the gutter. |
betterSvg.defaultColor |
string |
"#ffffff" |
The hex color used to replace currentColor in previews. |
betterSvg.removeClasses |
boolean |
true |
Whether to remove class attributes when running the optimization. |