Skip to main content
Better SVG provides several configuration options to customize the extension’s behavior. All settings can be configured in your VS Code settings (File > Preferences > Settings or Code > Preferences > Settings).

Panel behavior

betterSvg.autoReveal
boolean
default:true
Automatically reveal and expand the SVG Preview panel in Explorer when opening SVG files
betterSvg.autoCollapse
boolean
default:true
Automatically collapse the SVG Preview panel in Explorer when closing all SVG files

Preview settings

betterSvg.defaultColor
string
default:"#ffffff"
Default color for currentColor in the SVG preview (hex format, e.g., #ffffff)Must be a valid hex color code in the format #RRGGBB or #RGB.
betterSvg.enableHover
boolean
default:true
Enable hover preview for SVG elements in supported files
betterSvg.showGutterPreview
boolean
default:true
Show SVG preview icons next to line numbers in supported files

Optimization settings

betterSvg.removeClasses
boolean
default:true
Remove class attributes from SVG elements during optimizationWhen enabled, SVGO will strip class attributes from your SVG elements when you run the optimize command.

Build docs developers (and LLMs) love