1.1.1 • Published 5 years ago

react-native-transform-svg-file v1.1.1

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

react-native-transform-svg-file

Version

Transform SVG files to SVG components. Use react-native-svg.

Install library from npm

    yarn add react-native-transform-svg-file

Link react-native-svg (RN < 0.60)

    react-native link react-native-svg

Needed only for IOS (RN >= 0.60):

    cd ios && pod install

Go 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_path

Use 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

PropTypeDefaultNote
nameStringName of SVGfile more details
heightStringwidth of svg fileOverride height property in SVG component
widthStringheight of svg fileOverride width property in SVG component
viewBowStringviewBox of svg fileOverride viewBox property in SVG component

SVG Name props

"my-svg-file.svg" = MySvgFile;
"MySVGFile.svg" = MySVGFile;
1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago