Description
react-native-svg-transformer lets a React Native project import SVG files the same way a web application does. Using SVGR, it transforms each imported SVG into a React component, so the same SVG code can be used on React Native and on the web. svg file inside a component and then render it as a component. The library depends on react-native-svg, which must be installed first. Setup has three steps. js. 59 and later. Projects that use Expo modules without expo-cli may need a setting that makes React Native's transformer take over. ts. svgrrc file in the project root, which controls how SVGs are converted. For example, the README shows how to change fill colours to currentColor for every SVG in an app. Demo apps for iOS, Android and web via Expo are linked in the README.…
Highlights
- Import SVG files as React components
- Same SVG code for React Native and web
- Works with Expo and bare React Native
- Configured through SVGR options
- TypeScript declarations included
Ratings & Reviews
No ratings yet
Be the first to rate React Native SVG Transformer.
People also visit
React Native SVG Transformer FAQ
What does this library do?
It lets you import .svg files in a React Native app and use them as components, the way a web app does with SVGR.
What do I need first?
The react-native-svg library, which the README says must be installed before this package.
How is it configured?
By merging the transformer settings into metro.config.js. The README gives versions for Expo SDK 41 and later, React Native 0.72.1 and later, and 0.59 and later.
Does it work with TypeScript?
Yes, after adding a module declaration for SVG imports to a declarations.d.ts file.
How do I change SVG colours?
Through an .svgrrc file in the project root. The README's example changes fill colours to currentColor for all SVGs.
What are the best React Native SVG Transformer alternatives?
Popular alternatives to React Native SVG Transformer include Tiny SVG and SVG to Compose. See all React Native SVG Transformer alternatives












