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
What This Tool Does
SVG to JSX Converter is built for deterministic developer and agent workflows.
Convert an SVG into a clean React/JSX component with camelCased attributes, prop forwarding, and currentColor.
Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.
Last updated:
This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.
Agent Invocation
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.
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.