SVG to React / TypeScript Component Converter

Client-SideOffline Ready

Transform raw SVG markup into production-ready React (JSX/TSX) components with custom props, forwardRef, and currentColor support.

Raw SVG Input
Live Visual Preview
React (TypeScript / TSX)
Ready for Next.js, Vite, or Create React AppProp Interface: CustomIconProps

100% In-Browser Conversion

All parsing, DOM cleaning, attribute camel-casing, and JSX code generation runs strictly in your browser. Zero cloud dependencies.

TypeScript & ForwardRef Ready

Generates fully typed React components inheriting React.SVGProps<SVGSVGElement> with optional size props, className, and ref forwarding.

Dynamic currentColor Theme Support

Optionally strip hardcoded hex colors and replace them with currentColor so your icons automatically match Tailwind CSS text color classes.

Frequently Asked Questions

Why do raw SVG tags break in React and Next.js?
Standard HTML/XML SVG markup uses kebab-cased attributes (such as stroke-width, fill-rule, and clip-path) and the HTML "class" attribute. React requires camelCased JSX props (strokeWidth, fillRule, clipPath) and "className". This tool sanitizes and transforms them cleanly.
What is the benefit of replacing colors with currentColor?
Replacing hardcoded colors (like #000000 or #1E293B) with "currentColor" enables your React SVG component to inherit the CSS text color of its parent element. In Tailwind CSS, you can simply use "text-blue-600 hover:text-blue-700 dark:text-blue-400" without editing the icon.
Can I use this with icons exported from Figma, Illustrator, or Sketch?
Yes! Paste any SVG code directly from Figma (Right Click -> Copy as SVG) or upload an .svg file. The parser strips unnecessary metadata, doctypes, and editor comments.
What is React.forwardRef and should I enable it?
forwardRef allows parent components, tooltip wrappers (like Radix UI or Floating UI), or animation libraries (like Framer Motion) to pass an imperative DOM ref directly to the underlying <svg> element.
Recommended For You

More Dev Tools Utilities

View all Dev Tools tools