Convert SVG code into production-ready React JSX & TSX components. Automatically converts SVG attributes, preserves viewBox, and supports reusable props.
Drag & drop an .svg file, click Browse, or press Ctrl + V anywhere to convert.
Paste your raw SVG snippet (Ctrl+V) copied from websites, Figma, or GitHub, or upload an .svg file.
Set component name (e.g. ArrowRight), component format (JSX, TSX, Snippet), and toggle reusable props ({...props}).
ToolJi automatically converts attributes like stroke-width to strokeWidth, class to className, and fill-rule to fillRule while preserving viewBox.
Click 'Copy Code' or 'Download .jsx/.tsx' to use the generated component instantly in your Next.js or React application.
Standard HTML/XML SVG code cannot be directly pasted into React JSX because JavaScript reserves certain keywords and requires camelCase property names for DOM elements.
| XML / SVG Attribute | React JSX Attribute | Description |
|---|---|---|
| class="icon" | className="icon" | Prevents JS class keyword collision |
| stroke-width="2" | strokeWidth={2} | Converts kebab-case to camelCase property |
| fill-rule="evenodd" | fillRule="evenodd" | Converts fill rule winding property |
| xlink:href="#id" | xlinkHref="#id" | Converts XML namespace references |
| viewBox="0 0 24 24" | viewBox="0 0 24 24" | Preserved exactly as viewBox (capital B) |
| aria-label="Close" | aria-label="Close" | Preserved exactly for accessibility |
Simply paste your raw SVG code or upload an .svg file into ToolJi SVG to React Converter. The tool automatically transforms all SVG attributes into valid React JSX/TSX properties (e.g., class -> className, stroke-width -> strokeWidth) and generates clean, reusable component code.
Standard HTML/XML SVG code uses kebab-case attributes like stroke-width, fill-rule, and class. In React, JSX properties map to JavaScript DOM object properties which require camelCase naming like strokeWidth, fillRule, and className.
Yes! You can choose between JavaScript Functional Components (.jsx), TypeScript Typed Components (.tsx with React.SVGProps<SVGSVGElement>), or Simple JSX Snippets.
Yes. When 'Spread {...props}' is enabled, the generated component accepts all standard SVG props (className, style, onClick, width, height) so you can easily style and customize icons across your design system.
Yes! SVGs often contain internal IDs like id='clip0' or url(#clip0). When rendering multiple icons on the same webpage, duplicate IDs can collide and break clip paths or gradients. ToolJi automatically prefixes IDs with the component name to ensure rendering isolation.
No. All SVG parsing, DOM transformation, and JSX generation happen 100% locally inside your web browser. No code or design files are uploaded to any server.