{"id":17497521,"url":"https://github.com/moox/react-from-svg","last_synced_at":"2025-04-13T13:12:15.714Z","repository":{"id":34553399,"uuid":"180083317","full_name":"MoOx/react-from-svg","owner":"MoOx","description":"Transform SVG files into React components (native | web, JavaScript | TypeScript).","archived":false,"fork":false,"pushed_at":"2025-04-03T17:24:54.000Z","size":611,"stargazers_count":60,"open_issues_count":5,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-03T18:28:05.152Z","etag":null,"topics":["react","react-native","react-native-svg","reactjs","svg","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MoOx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-08T06:23:25.000Z","updated_at":"2025-04-03T17:24:58.000Z","dependencies_parsed_at":"2023-02-10T10:50:18.602Z","dependency_job_id":null,"html_url":"https://github.com/MoOx/react-from-svg","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Freact-from-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Freact-from-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Freact-from-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MoOx%2Freact-from-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MoOx","download_url":"https://codeload.github.com/MoOx/react-from-svg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717237,"owners_count":21150389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","react-native","react-native-svg","reactjs","svg","typescript"],"created_at":"2024-10-19T15:53:48.955Z","updated_at":"2025-04-13T13:12:15.708Z","avatar_url":"https://github.com/MoOx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React from SVG\n\n\u003ca href=\"https://github.com/MoOx/react-from-svg?sponsor=1\"\u003e\n  \u003cimg width=\"140\" align=\"right\" alt=\"Sponsoring button\" src=\"https://github.com/moox/.github/raw/main/FUNDING.svg\"\u003e\n\u003c/a\u003e\n\n[![GitHub package.json version](https://img.shields.io/github/package-json/v/MoOx/react-from-svg) ![npm downloads](https://img.shields.io/npm/dm/react-from-svg)](https://www.npmjs.com/package/react-from-svg)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/MoOx/react-from-svg/build.yml?branch=main)](https://github.com/MoOx/react-from-svg/actions)\n[![License](https://img.shields.io/github/license/MoOx/react-from-svg)](https://github.com/MoOx/react-from-svg)  \n[![GitHub followers](https://img.shields.io/github/followers/MoOx?style=social\u0026label=Follow%20me)](https://github.com/MoOx)\n[![LinkedIn Follow](https://img.shields.io/badge/Follow%20Me-on%20LinkedIn-gray?style=social\u0026logo=invision\u0026logoColor=%230077B5)](https://www.linkedin.com/in/maxthirouin/)\n[![BlueSky Follow](https://img.shields.io/badge/Follow%20Me-on%20BlueSky-gray?style=social\u0026logo=bluesky)](https://bsky.app/profile/moox.io)\n[![X Follow](https://img.shields.io/twitter/follow/MoOx?style=social\u0026label=Follow%20me)](https://x.com/MoOx)\n\n\u003e Transform SVG files into React components, Native and/or Web, JavaScript and/or TypeScript.\n\u003e Without minimal dependencies.\n\n## Install\n\n```console\nnpm install react-from-svg\n```\n\n## Usage\n\n```console\nreact-from-svg --help\n\nUsage\n  $ react-from-svg \u003csourcePath\u003e \u003coutputPath\u003e [--with-native|--with-web]\n\nOptions\n  --with-native, -rn                    Output code for react-native-svg\n  --with-native-for-typescript, -rnts   Output code for react-native-svg with TypeScript\n  --with-web, -rnw                      Output code for DOM. If --with-native is also used, will be output as .web.js files\n  --with-web-for-typescript, -rnwts     Output code for DOM with TypeScript. If --with-native is also used, will be output as .web.tsx files\n  --remove-fill, -rf                    Remove all 'fill' properties from SVGs, convenient for icons\n  --remove-stroke, -rs                  Remove all 'stroke' properties from SVGs, convenient for icons\n\nExample\n  $ react-from-svg assets/svgs src/Svgs --with-native --remove-fill\n```\n\nGenerated components will allow you to inject all the props you could use on an `\u003csvg\u003e`/`\u003cSvg\u003e`, such as:\n\n- `width`\n- `height`\n- `fill` (if you use `--remove-fill`)\n- `stroke` (if you use `--remove-stroke`)\n- `style`\n\n⚠️ To see what you can expect from the transformations, [check our snapshots](./tests/) 👀\n\n## Requirements\n\n### `--with-web(-*)`\n\nNeed you to have:\n\n- [React](https://reactjs.org)\n\nNote: if you use [React Native for Web](https://github.com/necolas/react-native-web), see requirements below.\n\n### `--with-native(-*)`\n\nNeed you to have:\n\n- [React](https://reactjs.org)\n- [React Native](https://reactnative.dev) (or an alternative platform like\n  [React Native Web](https://github.com/necolas/react-native-web))\n- [`react-native-svg`](https://github.com/react-native-community/react-native-svg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Freact-from-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoox%2Freact-from-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoox%2Freact-from-svg/lists"}