SVG to JSX
Paste SVG markup and get JSX back, with attributes renamed the React way and an optional component wrapper that spreads props onto the svg element.
0 characters
Everything runs in your browser. Your text is not uploaded for processing and never leaves this device.
Frequently asked questions
Which attributes get renamed?
The full React set: class becomes className, for becomes htmlFor, xlink:href becomes href, and hyphenated SVG attributes like stroke-width, fill-rule, and clip-path become strokeWidth, fillRule, and clipPath. Inline style strings become style objects, and data-* and aria-* attributes are left untouched.
What does the component wrapper add?
An exported function component with your chosen name that spreads {...props} onto the svg element, so you can pass className, width, or onClick when you use it. Handy for icon systems.
Does it optimize or clean up the SVG?
No. This tool only renames attributes and optionally wraps the markup; paths, groups, and whitespace are preserved exactly, so the rendered result cannot change.