react-native-svg-component
v0.3.1
Published
React Native SVG renderer using [react-native-svg](https://github.com/react-native-community/react-native-svg).
Maintainers
Readme
react-native-svg-component
React Native SVG renderer using react-native-svg.
Getting Started
Installation
add package
yarn add react-native-svg-componentlink native files We are using react-native-svg to render SVG. Please follow the its doc to finish setup.
Usage
- Import to the component where you want to show an SVG
import { Svg } from 'react-native-svg-component';- Send initial props
<Svg
source={{ uri: data }}
alt={`react native svg component example`}
width={160}
height={160}
style={{}}
/>Properties
| Prop | default | Type | Description | | --:| --:| --:| --:| | source | - | ImageSourcePropType | A source object the same with what Image component will accept. | | alt | - | string | Alt text which will be used as accessibility label for Svg | | width | - | number | Width of the Svg. | | height | - | number | Height of the Svg. | | style | - | StyleProp<ViewStyle> | Style for this component. |
Develop
brew install watchman
yarn global add gulp-cli
yarn all
yarn run-iosExamples
yarn run-ios
yarn run-android