blackdroid.dev

SVG to JSX / React Component

Convert SVG to JSX or a ready React component online for free. SVG attributes like stroke-width and fill-rule become JSX props — runs in your browser.

SVG
JSX

About SVG to JSX / React Component

Paste an SVG and get JSX with every attribute converted — stroke-width to strokeWidth, fill-rule to fillRule, clip-path to clipPath, xlink:href to href and more.

Optionally wrap the output in a React component function and strip xmlns attributes that React doesn't need. Conversion is fully local.

Everything runs locally in your browser — nothing you type, paste or drop is uploaded to a server.

How to use SVG to JSX / React Component

  1. Paste your SVG markup into the left pane.
  2. Toggle 'Wrap in a React component' and 'Strip xmlns' as needed.
  3. Copy the JSX into your project as an icon or illustration component.

Frequently asked questions

Why does SVG need conversion for React?

SVG attributes use kebab-case (stroke-width, fill-rule) that JSX doesn't accept — React expects camelCase props like strokeWidth and fillRule.

Should I keep the xmlns attribute?

No — React renders SVG in the right namespace automatically, so inline JSX doesn't need xmlns. Keep it only if the output goes into a standalone .svg file.

Does it handle gradients, masks and markers?

Yes — gradientTransform, markerEnd, clipPath and the other SVG camelCase props are all mapped automatically.