SVG TO JSX

Convert SVG to React JSX/TSX, Vue SFC, or Preact. Attribute normalization, currentColor, SVGO optimization.

COMPONENT
SVG INPUT
REACT TSX OUTPUT
Paste SVG input to see the converted component
OPTIONS
What gets converted
  • class → className
  • stroke-width → strokeWidth
  • fill-rule → fillRule
  • xlink:href → href
  • All SVG hyphenated attrs → camelCase
  • Comments & XML declarations removed
  • {...props} spread added to root
Output formats
  • JSX — React component with PropTypes
  • TSX — Typed with React.SVGProps<SVGSVGElement>
  • Vue SFC — Template + script setup, v-bind="$attrs"
  • Preact — Preact/compat import, JSX.SVGAttributes
Related tools