Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cartersusi/reactify-my-svg
Convert SVG into react components via CLI
https://github.com/cartersusi/reactify-my-svg
cli linux macos react svg
Last synced: 13 days ago
JSON representation
Convert SVG into react components via CLI
- Host: GitHub
- URL: https://github.com/cartersusi/reactify-my-svg
- Owner: cartersusi
- Created: 2024-08-19T16:56:14.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-02T04:58:33.000Z (about 1 month ago)
- Last Synced: 2024-10-06T04:05:26.036Z (about 1 month ago)
- Topics: cli, linux, macos, react, svg
- Language: Python
- Homepage:
- Size: 6.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reactify my SVG
* Turn SVG files into React components.
* Replace hyphens with camelCase in an SVG file.## Installation
```sh
git clone https://github.com/cartersusi/reactify-my-svg.git
cd reactify-my-svg
chmod +x install.sh
./install.sh
```
or
```sh
git clone https://github.com/cartersusi/reactify-my-svg.git && cd reactify-my-svg && chmod +x install.sh && ./install.sh
```## Usage
```
reactify [-h] -i INPUT -o OUTPUT [-p]
Replace hyphens with camelCase in an SVG file.options:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Input SVG file
-o OUTPUT, --output OUTPUT
Output JS/TS file
-p, --props Add props to the output file
```## Examples
### JS/JSX```sh
reactify -i test.svg -o main.js
``````js
export function main() {
return (
SVG
);
}
```### TS/TSX with props
```sh
reactify -i test.svg -o main.tsx -p
``````tsx
export function main(props:any) {
return (
SVG
);
}
```