{"id":20473538,"url":"https://github.com/xpl/parcel-plugin-svg-react","last_synced_at":"2025-10-24T10:28:06.696Z","repository":{"id":42855359,"uuid":"260765199","full_name":"xpl/parcel-plugin-svg-react","owner":"xpl","description":"Import SVG as React components (Parcel plugin)","archived":false,"fork":false,"pushed_at":"2023-01-06T04:50:27.000Z","size":1374,"stargazers_count":5,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T02:39:24.127Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/xpl.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-05-02T20:00:56.000Z","updated_at":"2020-05-30T08:25:08.000Z","dependencies_parsed_at":"2023-02-05T08:46:01.734Z","dependency_job_id":null,"html_url":"https://github.com/xpl/parcel-plugin-svg-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpl%2Fparcel-plugin-svg-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpl%2Fparcel-plugin-svg-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpl%2Fparcel-plugin-svg-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpl%2Fparcel-plugin-svg-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xpl","download_url":"https://codeload.github.com/xpl/parcel-plugin-svg-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248705160,"owners_count":21148490,"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":[],"created_at":"2024-11-15T14:25:47.683Z","updated_at":"2025-10-24T10:28:06.634Z","avatar_url":"https://github.com/xpl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parcel-plugin-svg-react\n\nParcel plugin for SVGR. Forked from \u003ca href=\"https://github.com/gregberge/svgr/tree/master/packages/parcel-plugin-svgr\"\u003e**@svgr/parcel-plugin-svgr**\u003c/a\u003e.\n\n```\nnpm install parcel-plugin-svg-react\n```\n\n## The Differences\n\n- `.svgr` extension for React imports\n- `.svg` extension for path imports\n- Allows CSS imports\n\n## React Imports\n\nAllows to import SVG files as React components. The extension should be `.svgr`, not `.svg`!\n\n```jsx\nimport Star from './star.svgr'\n\nconst App = () =\u003e (\n  \u003cdiv\u003e\n    \u003cStar /\u003e\n  \u003c/div\u003e\n)\n```\n\n## Usual Behavior\n\nAllows to import `.svg` files as paths (the usual Parcel behavior):\n\n```jsx\nimport star from './star.svg'\n\nconst Star = () =\u003e (\n  \u003cdiv style={{ backgroundImage: `url(${ star })` }}\u003e\u003c/div\u003e\n)\n```\n\n## CSS Imports\n\nThis works as well:\n\n```css\ndiv {\n  background-image: url(./star.svg);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpl%2Fparcel-plugin-svg-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxpl%2Fparcel-plugin-svg-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpl%2Fparcel-plugin-svg-react/lists"}