SVG to JSX converter
Turn SVG markup into a React component with camelCase attributes and props passed through, or into a data URI for CSS and HTML.
Runs in your browser. Nothing you enter is uploaded.
React component
About this tool
This converter turns SVG markup into a React function component. Attribute names become camelCase (class becomes className, data- and aria- stay as they are), inline style strings become style objects, and comments, the XML declaration and DOCTYPE are removed. The same input is also given as a URL-encoded and a base64 data URI.
- Can I pass className or width to the generated component?
- Yes. The component spreads its props onto the root svg element, so className, width, aria-label and other attributes pass through.
- What happens to CSS custom properties in a style attribute?
- Names that start with -- are kept as quoted keys in the style object, while other properties are converted to camelCase.