Convert SVG to a React component
Paste SVG code or drop files and get ready-to-use React components. Attributes are converted to their JSX names (stroke-width → strokeWidth, class → className), inline styles become style objects, and props are spread onto the root <svg> so you can size and color it from your app. Choose how the component is written — TypeScript, 1em icon sizing, currentColor, a title prop for accessibility, React.memo and forwardRef, named or default export — optimize the markup with SVGO first, and convert a whole icon set into one ZIP with an index file.
How to use it
- 1
Drop SVG files or a folder, or paste SVG code.
- 2
Choose JSX or TSX and how the component is written: icon size, currentColor, title prop, memo, forwardRef, export style.
- 3
Copy a component, download it as a .jsx / .tsx file, or download every component with an index as a ZIP.
Questions
What does the converter change?
SVG attributes become JSX props (fill-rule → fillRule, xlink:href → xlinkHref, class → className), style strings become objects, and comments and XML declarations are dropped. Everything else — gradients, masks, filters — is kept.
How do I change the icon's size or color?
The component spreads its props onto the <svg>, so <Icon width={32} className="text-blue-500" /> works. For color, set fill or stroke to currentColor in the source SVG and it follows the CSS text color.
How do I make the icon take the text color?
Turn on Use currentColor: fills and strokes become currentColor, so the icon follows the CSS color of wherever it's used (className="text-red-500" works). Gradients keep their colors. It's meant for single-color icons — a multi-color drawing becomes one color.
What do the icon size and title options do?
Icon size sets width and height to 1em, so the icon scales with the font size around it (the viewBox is kept, or made from the original width and height). The title prop adds title and titleId props that render a <title> and label the <svg>, giving the icon an accessible name.
Can I convert a whole icon set?
Yes. Drop many files or a folder; each becomes a component named after its file (arrow-left.svg → ArrowLeft, with duplicates numbered), and Download ZIP gives you every component plus an index file that re-exports them.
Does it work with React Native?
Use the SVG to React Native converter: it writes react-native-svg components (<Path>, <G>, …) and leaves out what React Native can't render.
Is my SVG uploaded?
No. The conversion runs in your browser; nothing is sent anywhere.
More free SVG tools
Need more than one change?
The Splice editor edits SVGs visually — shapes, text, colors, layers — across many files at once, with the code in sync.
Open the editor