Convert SVG markup to React-ready JSX. Paste any SVG and get a component you can drop directly into a React or Next.js project.
| SVG | JSX |
|---|---|
xmlns="..." | Removed (not needed in JSX) |
class="..." | className="..." |
stroke-width="2" | strokeWidth={2} |
fill-opacity="0.5" | fillOpacity={0.5} |
style="color: red" | style={{ color: "red" }} |
xlink:href="..." | href="..." |
| Self-closing tags | Properly self-closed with /> |
The converted SVG is wrapped in a functional React component:
export default function Icon(props) {
return (
<svg ...>
...
</svg>
);
}{...props} spread to the <svg> tag to forward className, width, height, etc. from the parentfill or stroke colors with currentColor to inherit CSS colortitle prop for accessibility<style> blocks are not converted — move styles to CSS or use className