Need help with svgr?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

gregberge
7.0K Stars 269 Forks MIT License 440 Commits 9 Opened issues

Description

Transform SVGs into React components 🦁

Services available

!
?

Need anything else?

Contributors list

No Data

svgr

Transform SVGs into React components 🦁

License Donate npm package npm downloads Build Status Code Coverage Code style Dependencies DevDependencies

Try it out online!

Watch the talk at React Europe

SVGR transforms SVG into ready to use components. It is part of create-react-app and makes SVG integration into your React projects easy.

Docs

See the documentation at react-svgr.com for more information about using

svgr
!

Quicklinks to some of the most-visited pages:

Example

Take an icon.svg:

  
  Rectangle 5
  Created with Sketch.
  
  
    
      
        
          
            
              
            
          
        
      
    
  

Run SVGR

npx @svgr/cli --icon --replace-attr-values "#063855=currentColor" icon.svg

Output

import * as React from 'react'

const SvgComponent = (props) => ( )

export default SvgComponent

Supporting SVGR

SVGR is a MIT-licensed open source project. It's an independent project with ongoing development made possible thanks to the support of these awesome backers. If you'd like to join them, please consider:

Gold Sponsors

Gold Sponsors are those who have pledged \$100/month and more to SVGR.

gold-sponsors

Contributing

Check out the contributing guidelines

License

Licensed under the MIT License, Copyright © 2017-present Smooth Code.

See LICENSE for more information.

Acknowledgements

This project has been popularized by Christopher Chedeau and it has been included in [create-react-app] thanks to Dan Abramov. We would like to thanks Sven Sauleau for his help and its intuition.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.