Attribute changes
| SVG | JSX |
|---|---|
| class | className |
| stroke-width | strokeWidth |
| xlink:href | xlinkHref |
| style="fill-opacity: .5" | style={{ fillOpacity: ".5" }} |
Related tools
Frequently asked questions
Why can’t I paste SVG straight into JSX?
JSX uses JavaScript names for attributes – className instead of class, strokeWidth instead of stroke-width – and style must be an object, so raw SVG produces errors or warnings.
What changes are made?
Hyphenated and namespaced attributes are camelCased, class becomes className, inline styles become objects, and the XML declaration and editor metadata are removed.
What does currentColor do?
Fill and stroke colours are replaced with currentColor, so the icon takes the text colour of its parent and can be recoloured with CSS.
Why spread props?
It lets you pass className, width, aria-label or onClick when you use the component, without editing it.
Are scripts removed?
Yes – script elements, foreignObject and on… event attributes are removed for safety.
Does it work with Next.js and Vite?
Yes – the output is a plain function component that works in any React setup.
Should I optimise the SVG first?
Yes for exported files – run it through our SVG optimiser to remove hidden layers and extra precision, then convert.
How do I make the icon accessible?
Pass aria-hidden="true" for decorative icons, or role="img" and aria-label for meaningful ones.
Can I use it for React Native?
React Native needs react-native-svg components (Svg, Path) – rename the tags, as the attributes are already camelCased.
Does it handle xlink:href?
Yes – it becomes xlinkHref; modern browsers also accept plain href.
Is it free?
Yes – no sign-up, no limits and no watermark.
Is my input uploaded?
No. Everything runs in your browser tab; nothing you paste or open is sent to Docelora.
Can I use the output in commercial projects?
Yes. What you generate is yours to use however you like.
Does it work on a phone?
Yes – the layout adapts to small screens, though long code is easier to work with on a larger display.
How do I copy the result?
Use the Copy button under the result, or Download to save it as a file.
Which browsers are supported?
Current versions of Chrome, Edge, Firefox and Safari.
Do I need to install anything?
No – it runs in your web browser, and any library it needs is loaded from Docelora the first time you use it.
Is my input kept after I close the page?
No – copy or download the result before closing the tab.
Can I suggest an improvement?
Yes – use the Contact page to tell us what would make the tool more useful.
Does it work offline?
Once the page and its library have loaded, the processing itself needs no connection.
Last reviewed: 16 November 2026.