Extension Icon

SVGR

Paste in SVG code. Get a react component.
AvatarRick McGavin
1,065 Installs
Overview

SVGR

Paste in SVG. Get a react component.

This extensions uses SVGR to take raw, unoptimized SVG code and convert it to an optimized React component.

SVGR Options

You can customize the output of your react components with SVGR's options. You can reference the offical SVGR docs for further information on all of SVGR's options. This extension currently supports the following options that can be accessed with the "Customize SVGR Settings" action in the action panel.

option namedefaultoptionsmore info
dimensionstruetrue falsedimensions
iconfalsetrue falseicon
memofalsetrue falsememo
nativefalsetrue falsenative
reffalsetrue falseref
svgotruetrue falsesvgo
titlePropfalsetrue falsetitleProp
typescriptfalsetrue falsetypescript
expandPropsend"end" "start" falseexpandProps
exportType"default""named" "default"Use "named" for a named export. Use "default" for a default export.
jsxRuntime"classic""classic" "automatic" "classic-preact"jsxRuntime

SVGO Options

You can customize your SVGO configuration file like you would any SVGO configuration. This extension uses a .svgorc.json file. You can open this file with the "Open SVGO Settings" action in the action panel. For more information on SVGO configuration:

Prettier Options

This extension does not currently support the prettier option for SVGR.