SVG to React/JSX Component Converter
Convert SVG into React/JSX components. Auto kebab-case → camelCase attributes, TypeScript types, currentColor, size/color props.
Convert SVG (raw XML or Figma export) into a React/JSX component. Changes kebab-case attributes to camelCase, escapes <style>, optional TypeScript types.
When to convert SVG → JSX
- From Figma exports: designer exports SVG → you paste it into a React component.
- Custom icon libraries: instead of react-icons, build your own from Heroicons / Tabler.
- Logos + illustrations: brand SVGs → components with size/color props.
- Animation: convert to JSX so state can drive attributes.
SVG vs JSX differences
- kebab-case → camelCase:
stroke-width→strokeWidth,fill-rule→fillRule. - class → className (JSX rule for HTML/SVG elements).
- style: CSS string → object:
style="color:red"→style={{color: 'red'}}. - <style> tags: wrap the CSS in a backtick expression so it isn't parsed:
<style>{`...`}</style>. - viewBox: STAYS camelCase (it isn't
view-box).
Props pattern tips
- size prop: width/height take props for easy resizing. Default 24.
- currentColor: use
fill="currentColor"so icons inherit the parent'scolor— change color viaclassName="text-red-500". - ...props spread: lets consumers pass
onClick,aria-label, etc. - TypeScript: extend
React.SVGProps<SVGSVGElement>for full type safety.
Who this is for
Frontend devs, UI/UX designers, anyone prototyping visuals fast or generating CSS for Tailwind/React/Vue projects.
FAQ
Does the generated CSS work with Tailwind?
Yes. Output is vanilla CSS, paste into any .css file. For Tailwind projects, use @utilities layer or theme overrides.
Browser compatibility?
Modern CSS syntax (custom properties, grid). Works on Chrome/Firefox/Safari 2020+. IE11 NOT supported.
Related tools
See all tools →Color Picker
Pick HEX/RGB/HSL, RGB sliders, 12 presets, nearest Tailwind name.
NEWTailwind ↔ CSS Converter
Convert between Tailwind utility classes and vanilla CSS. ~200 utilities (spacing, color, flex, grid…). Helps migration.
NEWCSS Animation Builder
Visual builder for CSS animations. 10 presets (fadeIn, bounce, pulse, spin, shake…). Tweak duration, easing, iteration.
NEWCSS Filter Builder
Visual builder for CSS filters — blur, brightness, sepia, hue-rotate, drop-shadow. 8 presets (Vintage, Polaroid, Noir…).