SVGR
Development library / tool · Free
An SVG-to-React component converter with a CLI, optimization settings, and build integration for a maintainable project icon collection.
Also known as: gregberge/svgr

What you can use for free
SVGR code is available free of charge for local and commercial projects, subject to its license.
Paid features and costs
This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
Access and limitations
SVGR code is available free of charge for local and commercial projects, subject to its license. This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
Use cases
- Processing SVGs for React
- Maintainable icons in a project
Example workflow
A possible workflow; this is not a report of hands-on testing.
Processing SVGs for React with SVGR.
Before you start
- A working React; SVG; Node.js project and a specific use case: processing SVGs for React.
- A design, interface states, or dataset; target screens and accessibility requirements.
Steps
- Check the project's stack and version against the current SVGR documentation; add the package or the required source component.
- Implement the selected workflow with the supplied data, adapting styles and states to the project.
- Check the result in the target environment, remove sample data, and retain the notices required by the license.
Check your result
- The example works in the chosen tech stack, including target dimensions and input errors.
- Dependency size, keyboard behavior, and reduced motion suit the task; license terms are met.
Choosing SVGR
Processing SVGs for React
Choose this when
- Processing SVGs for React
- Maintainable icons in a project
Requirements
- Choose a web/native template and align dimensions, viewBox, title/ARIA, and SVGO configuration.
Things to consider
- Costs and limits of free use: This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
- Terms of use: MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.
- Generating a React component does not make every SVG accessible automatically. Optimization may change title/desc, so check the result.
Frequently asked questions
What can you use for free in SVGR?
SVGR code is available free of charge for local and commercial projects, subject to its license.
What additional costs might arise with SVGR?
This library does not require a paid plan. Development and hosting of the finished application are separate from the free code license.
What terms of use matter for SVGR?
MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.
How do you get started with SVGR?
Check the project's stack and version against the current SVGR documentation; add the package or the required source component. Implement the selected workflow with the supplied data, adapting styles and states to the project. Check the result in the target environment, remove sample data, and retain the notices required by the license.
How do I configure an SVG component's dimensions and accessible name in SVGR?
icon replaces width/height with the specified value, defaulting to 1em; dimensions:false removes original dimensions. titleProp/descProp add the corresponding props, while svgProps sets role/ARIA. SVGO is enabled by default, and prefixIds reduces id/class name collision risk; native uses react-native-svg and removes unsupported nodes.
License
MIT: permits commercial use, modification, and distribution of the code at no charge, provided the license text and copyright notice are retained.
MIT — permissive license
You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.
License termsTechnologies and topics
- React
- SVG
- Node.js