git404hub

what is svgr fr?

gregberge/svgr — explained in plain English

Analysis updated 2026-06-24

11,029TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

tl;dr

SVGR converts SVG image files into React components automatically, so you can use icons and illustrations as interactive, prop-accepting pieces of your UI without rewriting markup by hand.

vibe map

mindmap
  root((svgr))
    What it does
      SVG to React convert
      Prop-ready output
      SVG optimization
    Usage modes
      CLI tool
      Webpack plugin
      Node.js library
    Use cases
      Icon components
      Illustration reuse
      Build automation
    Audience
      React developers
      Frontend designers
      Build engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Convert a folder of SVG icons into reusable React components you can resize and recolor with props

VIBE 2

Use the SVGR webpack plugin to automatically convert imported SVG files during your JavaScript build

VIBE 3

Run SVGR from the terminal as a CLI tool to transform individual SVG files into React components

VIBE 4

Use the online playground at react-svgr.com to preview the React component output without installing anything

what's the stack?

TypeScriptNode.jswebpack

how it stacks up fr

gregberge/svgrbytebot-ai/bytebotgristlabs/grist-core
Stars11,02911,01311,045
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/54/54/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

in plain english

SVGR is a tool that converts SVG image files into React components. SVG is a format for vector graphics (logos, icons, illustrations that stay sharp at any size), and React is a popular JavaScript library for building user interfaces. Normally, using an SVG inside a React app requires some manual work to make it fit the component model. SVGR automates that conversion entirely. You point SVGR at an SVG file and it outputs a clean React component you can drop straight into your code. That component accepts the same props as any React element, so you can resize it, change its color, or wire it up to click handlers just like any other piece of your UI. The tool also runs the SVG through an optimizer first, stripping out unnecessary metadata and attributes that design tools like Sketch tend to leave behind. SVGR can be used in several ways: as a command-line tool you run directly in a terminal, as a plugin for webpack (a common build tool for JavaScript projects), or as a Node.js library you call from your own scripts. There is also an online playground at react-svgr.com where you can paste an SVG and immediately see the React component output, without installing anything. The project is MIT licensed and free to use. It was developed by Greg Berge and gained wider adoption after being included in create-react-app, a standard starter kit for React projects. It is supported through sponsorships on GitHub and OpenCollective. If you are building a React application and want to include icons or illustrations as interactive components rather than static image tags, this library handles the conversion so you do not have to rewrite SVG markup by hand.

prompts (copy fr)

prompt 1
Show me how to use the SVGR CLI to batch-convert a folder of SVG icons into React components
prompt 2
How do I configure the SVGR webpack plugin so all SVG imports in a project automatically become React components?
prompt 3
How do I make an SVGR-generated React component accept a size and fill color as props?
prompt 4
Show me how to use SVGR as a Node.js library in a build script to convert SVGs programmatically
prompt 5
What cleanup does SVGR apply to SVG files exported from Sketch or Figma before converting them?

Frequently asked questions

what is svgr fr?

SVGR converts SVG image files into React components automatically, so you can use icons and illustrations as interactive, prop-accepting pieces of your UI without rewriting markup by hand.

What language is svgr written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, webpack.

What license does svgr use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is svgr to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is svgr for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.