SVG to JSX Converter
Convert an SVG into a React component with camelCased attributes, className, style objects, optional TypeScript props, prop spread and currentColor.
SVG to JSX Converter
Paste SVG markup to generate a React component.
Conversions applied
stroke-width→strokeWidth(camelCase)class→className,for→htmlForxlink:href→xlinkHref- inline
stylestring → style object data-*/aria-*left untouched- empty elements self-closed
Updated . Provided as is. Check the output before you rely on it in production.
How to use SVG to JSX Converter
- 1
Paste your SVG markup
Drop a complete <svg>...</svg> snippet into the input, or press Load Sample to convert an example icon. Malformed markup is reported with an inline error.
- 2
Name the component and pick options
Set the component name and toggle TypeScript, prop forwarding, and currentColor to match how you intend to use the icon in your codebase.
- 3
Review the generated component
The output panel updates live, showing camelCased attributes, a style object where needed, and self-closed empty nodes ready to drop into a React project.
- 4
Copy it into your project
Use Copy to move the component into a .tsx or .jsx file, then import and render it like any other React icon.
Questions and answers
What does the SVG to JSX converter do?
Does it output TypeScript?
What does the currentColor option do?
Are props forwarded to the SVG?
Does my SVG get uploaded?
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/svg-to-jsx/
For automation planning, fetch the canonical contract at /api/tool/svg-to-jsx.json.