ToolSpark

SVG to React Component

Convert SVG code to React JSX components. Handles attribute renaming, style objects, TypeScript, and memo wrapping.

Share:𝕏fin
SVG<Icon />
SVG Input
React Component15 lines
interface MyIconProps {
  className?: string;
  size?: number;
}

export default function MyIcon({ className, size = 24 }: MyIconProps) {
  return (
  <svg className={className} xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
    <circle cx="12" cy="12" r="10"/>
    <line x1="12" y1="16" x2="12" y2="12"/>
    <line x1="12" y1="8" x2="12.01" y2="8"/>
  </svg>
  );
}

SVG Preview

Frequently Asked Questions

Related Tools