react-native-svg-view
is a wrapper on popular native svg libraries Macaw and Glide. This library allows you to read svg file from a url.
You can find lots of libraries, which support svg in react native, but mostly of them are based on JSX or WebView approach. This library process svg data using a separate thread created on native side, so JS thread is not blocked due processing. Currently library supports data source from the internet.
npm install react-native-svg-view
or
yarn add react-native-svg-view
import SvgView from 'react-native-svg-view';
<SvgView
source="https://www.dropbox.com/s/d1dbdvo4l7xry4w/downdogflip.svg?raw=1"
style={{ height: 24, width: 24 }}
/>;
Prop | Description | Platform |
---|---|---|
style?: StyleProp |
component style | both |
source: string | svg url | both |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT