/react-native-svg-uri

Render SVG images in React Native from an URL

Primary LanguageJavaScript

react-native-svg-uri

Render SVG images in React Native from an URL or a static file

This was tested with RN 0.33 and react-native-svg 4.3.1 (depends on this library) react-native-svg

Not all the svgs can be rendered, if you find problems fill an issue or a PR in order to contemplate all the cases

Install library from npm

npm install react-native-svg-uri --save

Link library react-native-svg

react-native link react-native-svg

Here's a simple example:

import SvgUri from 'react-native-svg-uri';

class TestSvgUri extends Component {
  render() {
    return (
      <View style={styles.container}>
         <SvgUri width="200" height="200"
                 source={{uri:'http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg'}} /> 
      </View>
    );
  }
}

or a static file

 
         <SvgUri width="200" height="200"
                 source={require('./images/homer.svg')} /> 
     

This will render:

Component example