Why Convert SVG to a Component?
Pasting raw SVG markup into JSX or a template works until it
doesn't: kebab-case attributes like stroke-width throw
TypeScript/React errors, hardcoded colors can't be themed with CSS,
and every icon usage duplicates the same boilerplate. Wrapping the
SVG in a real component fixes all three — correct attribute casing
for the target framework, optional currentColor theming,
and full prop forwarding (className, onClick,
ARIA attributes) from a single definition.
Framework Output Comparison
Each framework has different conventions for props, typing, and attribute casing. This tool generates the correct shape for whichever target you pick:
| Framework | Output | Typing | Notes |
|---|---|---|---|
| React (TSX) | Function component, camelCase props | React.SVGProps<SVGSVGElement> | Optional forwardRef, currentColor theming |
| Vue 3 | Single-file component, <script setup> | defineProps with TS interface | Attrs pass through via v-bind |
| Svelte 5 | Runes-based component | $props() with TS interface | Attrs spread onto root <svg> |
| Solid | Function component, camelCase props | JSX.SvgSVGAttributes<SVGSVGElement> | Fine-grained reactive, no VDOM overhead |
| Astro | .astro component, server-rendered | Props interface | Zero client-side JS by default |
| React Native | react-native-svg element tree | SvgProps from react-native-svg | PascalCase native elements (Path, Circle, etc.) |