Free tool

Runs in your browser

SVG to React component converter

Turn SVG files into React components, in JavaScript or TypeScript, optimized first with SVGO. Your files never leave your device.

1 · Add SVGs

Or paste SVG code

2 · Options

2

3 · Optimized

Loading the optimizer…
Add an SVG above to see the result.

From SVG file to React component

Pasting raw SVG into JSX breaks in small ways: class has to become className, stroke-width becomes strokeWidth, and inline styles need to be objects. The converter handles all of that, and optimizes the SVG with SVGO first so the component carries no editor clutter.

Each component is a plain function that passes props such as className, width or aria-label through to the <svg>. Choose JavaScript or TypeScript, copy it, or download every file as a zip.

For single-color icons, turn on Use currentColor so the icon takes the text color around it, and set it with CSS like any text.

Questions

Does it work with Next.js and Vite?

Yes. The output is a standard function component with no dependencies beyond React.

Are my files uploaded?

No. SVGO and the conversion run in your browser, inside this page.

More tools

Free tools that run in your browser

Responsive image converter

Turn one image into WebP, AVIF and JPEG at every width, with picture markup ready to paste.

2.4 MB → 142 KB

Font subsetter

Keep only the characters your site uses and ship the font as WOFF2, with @font-face CSS.

207 KB → 35 KB

SVG optimizer

Strip editor clutter from SVGs and export them as inline SVG, React components or CSS.

12 KB → 3.0 KB

Favicon generator

Turn one logo into favicon.ico, an SVG icon, home screen icons and a web manifest.

1 logo → 6 icons