Loading

HTML to JSX turns inline SVG markup into a clean React component. Pick an icon or logo straight from any web page with the Chrome extension, or paste vector code into the converter above, then grab a component ready for your project — plain JSX or typed TSX.

Nothing is redrawn, nothing approximated. What you select is what comes out: same paths, same gradients, same proportions, just spelled how React wants them.

From an icon on a page to a component

The extension adds a picker to whatever tab you have open. Hover over an inline icon or logo, click it, and that markup travels to our server, where it becomes a React component. A workspace opens with generated code, live preview, and download button.

This matters for logos and icon sets that exist only inside someone else’s markup. Instead of hunting for an original asset file or redrawing shapes by hand, you select the rendered element — out comes source code drawing exactly what was on screen.

What happens to SVG attributes

Raw vector markup uses kebab-case attribute names, while React expects camelCase. Converting svg to react means rewriting every one of them: stroke-width becomes strokeWidth, fill-rule becomes fillRule, clip-path becomes clipPath, and so on across all presentation attributes. class becomes className; inline style strings become style objects.

Everything that defines the drawing itself is preserved: viewBox, path data, gradients, masks, filters, defs with their id references. Scripts, event handlers, and tracking attributes are stripped, so captured or pasted markup cannot execute anything in your project.

Why inline vectors belong in components

A graphic rendered as JSX scales with your layout, inherits currentColor from surrounding text, and ships inside your bundle without an extra network request. You can pass props into it, swap fills from state, animate individual paths with CSS — none of which an img tag allows.

That is why icon libraries ship components rather than image files — one-off logos deserve equal treatment.

Typed output for TSX projects

Choose TSX for a typed result: a named export function in a .tsx file, formatted with Prettier. Choose JSX when your codebase is plain JavaScript. One conversion pass covers both svg to jsx and svg to tsx — switching language in the workspace simply regenerates the file.

Paste SVG code right on this page

No extension installed? Paste vector markup into the HTML field of the converter at the top of this page. Our site renders that paste in a hidden sandboxed frame — scripts never run — captures it, then sends it through the same pipeline page captures use. You get an identical result: a React component with your drawing intact, plus Tailwind, CSS, and inline style variants of any styling it carried.

Frequently asked questions

Does converting change my paths or coordinates?

No. Path data, coordinates, and viewBox pass through untouched. Only attribute names are rewritten into React’s camelCase spelling.

Are gradients and masks supported?

Yes. Gradients, masks, and filters are kept, including their defs plus the id references between them.

Can I get a typed TSX component?

Yes. Pick TSX in the workspace for a named export in a .tsx file, or pick JSX for plain JavaScript projects.

Is my SVG uploaded anywhere?

Conversion runs on our server, so markup you capture or paste is sent there, stored temporarily, then deleted. Our privacy page has the details.

Paste your SVG in the converter above →