Skip to main content

SVG to React Converter

Convert SVG code to React components instantly.
Paste your SVG and get a ready-to-use component.

React component will appear here...

What this tool does

Converts Attributes

Transforms SVG attributes to JSX format: stroke-width becomes strokeWidth, class becomes className

Adds Props Spreading

Automatically adds {...props} to the SVG element so you can pass custom attributes like className, style, etc.

TypeScript Support

Generates properly typed components using React.SVGProps<SVGSVGElement> for full type safety

Common Attribute Conversions

class→className
stroke-width→strokeWidth
fill-rule→fillRule
clip-path→clipPath
stroke-linecap→strokeLinecap
stroke-linejoin→strokeLinejoin
xlink:href→xlinkHref
xmlns:xlink→xmlnsXlink