troZee / react-native-svg-view

MIT License
20 stars 2 forks source link

react-native-svg-view

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.

Objecitve

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.

Installation

npm install react-native-svg-view

or

yarn add react-native-svg-view

Usage

import SvgView from 'react-native-svg-view';

<SvgView
  source="https://www.dropbox.com/s/d1dbdvo4l7xry4w/downdogflip.svg?raw=1"
  style={{ height: 24, width: 24 }}
/>;

API

Prop Description Platform
style?: StyleProp component style both
source: string svg url both

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

Alternatives

react-native-svg

react-native-svg-uri

react-native-svg-asset-plugin

License

MIT