🖼️

SVG to JSX / React Component

SVG to JSX / React Component——免费在线工具,快速精确。

SVG to JSX — Converts SVG attributes to JSX-compatible format (camelCase, className, etc.). Supports React, React Native, Svelte, and Vue formats.
Conversions: stroke-width → strokeWidth, class → className, fill-rule → fillRule, style strings → objects (for RN), etc.
'; } else { // JSX - wrap in export result = 'const SvgIcon = () => (\n ' + result.replace(/\n/g, '\n ') + '\n);\n\nexport default SvgIcon;'; } this.outputCode = result; }, copyResult() { window.toolUtils.copyText(this.outputCode); }, loadSample() { this.inputSvg = ` `; this.convert(); }, init() { this.loadSample(); } }; }