@delightfulstudio/react-native-svgson

0.0.1 • Public • Published

react-native-svgson

Based on react-native-svgx by Jose Antonio Sanchez.

Installation

$ npm install @delightfulstudio/react-native-svgson --save

Example

import * as Svg from 'react-native-svg';
// or import { Svg } from 'expo';
import SvgJson from 'react-native-svgson';

import checkmark from '../icons/checkmark.json';

function renderCheckmark() {
  const styles = {
    svg: {
        height: 38, // override default dimensions
        width: 38,
    },
    path: {
        fill: '#000000' // all <path> elements
    },
    '#circle-path': {
      fill: '#222222' // path with id="circle-path"
    }
  };

  return <SvgJson svgLib={Svg} data={checkmark} style={styles} />;
}

Dependencies (0)

    Dev Dependencies (20)

    Package Sidebar

    Install

    npm i @delightfulstudio/react-native-svgson

    Weekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    218 kB

    Total Files

    5

    Last publish

    Collaborators

    • delightfulstudio