Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>svg2jsxNew to Visual Studio Code? Get it now.
svg2jsx

svg2jsx

pugson

|
70 installs
| (0) | Free
Convert SVG to JSX in React components on save.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

svg2jsx – Visual Studio Code Formatter Extension

A formatter extension for Visual Studio Code that converts plain <svg></svg> tags in .js / .ts / .jsx / .tsx files to JSX syntax via SVGR, converting attributes like class, fill-opacity and image-rendering to className, fillOpacity and imageRendering respectively.

Installation

with npm

git clone https://github.com/darrylyeo/vscode-svg2jsx
npm i
npm run package
npm run install

with bun

git clone https://github.com/darrylyeo/vscode-svg2jsx
bun i
bun run package
bun run install

Usage

In Visual Studio Code, open the Command Palette with Cmd+Shift+P, then type and select "Format Document With..." → svg2jsx.

Optionally, in Settings, set Editor: Default Formatter to svg2jsx and enable Editor: Format On Save.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft