Extension to improve working with SVGs on Visual Studio Code, Cursor and other editors

.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, .html.jsx, .tsx.vue.astro.svelte.php.blade.php.liquiddjango-html templates.ejs.erbThe 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. |
| Setting | Type | Default | Description |
|---|---|---|---|
betterSvg.removeClasses |
boolean |
true |
Remove class attributes during optimization. Only applies to standalone .svg files; inline framework SVGs always keep their classes. |
betterSvg.removeComments |
boolean |
true |
Remove comments from the SVG during optimization. |
betterSvg.removeDoctype |
boolean |
true |
Remove the <!DOCTYPE> declaration during optimization. |
betterSvg.cleanupIds |
boolean |
false |
Minify and remove unused IDs. Disabled by default because it can break sprites, references and animations. |
betterSvg.floatPrecision |
number |
3 |
Number of decimal places to keep for numeric values (lower means smaller files but less precision). |
betterSvg.multipass |
boolean |
true |
Run SVGO multiple times until the output stops shrinking for better compression. |