react-native-transform-svg-file
v1.1.1
Published
Transform your SVG files an SVG components
Maintainers
Readme
react-native-transform-svg-file
Transform SVG files to SVG components. Use react-native-svg.
Install library from npm
yarn add react-native-transform-svg-fileLink react-native-svg (RN < 0.60)
react-native link react-native-svgNeeded only for IOS (RN >= 0.60):
cd ios && pod installGo to react-native-svg for more details;
Generate SVG components
- create directory in your react-native application
- store your svg in this directory
- launch
rntsf -g svg_directory_pathUse SVG components
import React from 'react';
import { View } from 'react-native';
import SVG from 'react-native-transform-svg-file';
const ExampleSVG = () => (
<View>
<Svg name="MySvgName" />
</View>
);
export default ExampleSVG;Props
| Prop | Type | Default | Note |
|---|---|---|---|
| name | String | | Name of SVGfile more details
| height | String | width of svg file | Override height property in SVG component
| width | String | height of svg file | Override width property in SVG component
| viewBow | String | viewBox of svg file | Override viewBox property in SVG component
