React supports SVG out of the box, it's simpler, easier and much more powerful to have components instead of SVG files. Wrapped in a React component, your SVG is inlined in the page and you can style it using CSS. SVGR differs from other library by its solid architecture. It uses svg-parser + Babel to transform SVG code into JavaScript code. A whole directory can be processed, all SVG files (matching .svg or .SVG) are transformed into React components. It is possible to target React Native using react-native-svg. SVGR exposes a Node API, you can create a custom script or build another tool based on SVGR. SVGR can be used as a webpack loader, this way you can import your SVG directly as a React Component. SVGR ships with a handful of customizable options, usable in both the CLI and API. Modify all SVG nodes with uppercase and use a specific template with react-native-svg imports. All unsupported nodes will be removed.

Features

  • A SVG to React transformer
  • A Node library
  • A CLI tool
  • A webpack plugin
  • Easy integration
  • Flexibility of performance

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow SVGR

SVGR Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of SVGR!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript User Interface (UI) Software

Registered

2021-07-28