Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/warungpintar/rnsvg-generator

generate react-native-svg component from .svg file
https://github.com/warungpintar/rnsvg-generator

generator react-native react-native-svg svg

Last synced: about 4 hours ago
JSON representation

generate react-native-svg component from .svg file

Awesome Lists containing this project

README

        

# rnsvg-generator

[![npm version](https://badge.fury.io/js/rnsvg-generator.svg)](https://www.npmjs.com/package/rnsvg-generator)
[![build](https://github.com/warungpintar/rnsvg-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/warungpintar/rnsvg-generator/actions/workflows/ci.yml)

convert any svg files into programmable React Component that compatible to `react-native-svg`

## Usage

```bash
npx rnsvg-generator source-path-or-folder -o output-path-or-folder
```

or install it globally

```bash
npm i -g rnsvg-generator
```

## Example

this svg code

```svg



```

will be converted into

```tsx
import React from "react";
import { Linejoin, Linecap, Svg, Path } from "react-native-svg";

export interface BillProps {
outerFill?: string;
innerFill?: string;
outerStroke?: string;
innerStroke?: string;
width?: number;
height?: number;
strokeWidth?: number;
strokeLinecap?: Linecap;
strokeLinejoin?: Linejoin;
}

const Bill: React.FC = (props) => (






);

export default Bill;
```

## License

MIT

![Hi-Five](https://media.giphy.com/media/JhThbOq62vwn6/giphy.gif)