Why not paste SVG straight into React?
Pasting raw SVG into a .jsx file usually produces a wall of warnings: "Invalid DOM property stroke-width", "Invalid DOM property class" or a hard compile error when the file contains a style attribute or an XML declaration. Each attribute has to be renamed by hand, which is slow and error-prone for large icon sets.
This converter does the renaming for you and wraps the markup in a component that accepts props. Because {...props} is spread onto the root <svg>, you can pass className, aria-label, onClick or a custom width from the parent without editing the icon again.
Recommended settings for React icons
For a reusable icon component we suggest:
- Enable currentColor so the icon inherits the text color of its parent and works in dark mode.
- Enable the size prop to control width and height with a single value such as size={20}.
- Keep the viewBox and remove fixed width and height so the icon scales with CSS.
- Use forwardRef only when a parent needs the underlying <svg> element, for example for tooltips or animations.
Inline components vs. image files
Inline SVG components can be styled with CSS, animated, and change color on hover, and they never cause an extra network request. For large illustrations that never change, a plain <img src="/file.svg"> may be cheaper because the browser can cache it separately. Use components for icons and UI graphics, and image tags for heavy artwork.