From SVG file to component
Paste SVG markup or drop files, pick a framework, and copy the result. For React the converter rewrites attributes to JSX
(stroke-width → strokeWidth, class → className), turns inline
style strings into objects, removes the XML prologue, comments and namespace attributes, replaces fixed
dimensions with a default size, and spreads {...props} on the root so the component accepts
className, event handlers and ARIA attributes like any other element. The component name comes from the file
name in PascalCase (arrow-right.svg → ArrowRight).
Frameworks
- React —
.jsxor typed.tsxwithReact.SVGProps<SVGSVGElement>; optionalmemo()wrapper andtitleprop. - React Native — elements mapped to
react-native-svgcomponents (Svg,Path,G…) with the import statement generated. - Vue 3 — single-file component with
v-bind="$attrs"on the root and<script setup>. - Svelte — component with a
sizeprop and{...$$restProps}.
Recommended settings for UI icons
Keep currentColor on so the icon follows CSS color, keep the default size at 1em
so it scales with surrounding text, and enable the title prop if the icon ever conveys meaning on its own.
Optimise the SVG first with the SVG Optimizer — the component is only as small as the markup
inside it. If you have dozens of icons, a sprite is often lighter than dozens of
components; many teams use both.