{"id":15391362,"url":"https://github.com/pascalduez/babel-plugin-jsx-svg","last_synced_at":"2026-04-16T18:01:53.668Z","repository":{"id":66028318,"uuid":"164158414","full_name":"pascalduez/babel-plugin-jsx-svg","owner":"pascalduez","description":"Tree shackable SVG aliases for JSX","archived":false,"fork":false,"pushed_at":"2019-01-05T12:53:10.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T04:59:40.258Z","etag":null,"topics":["babel","babel-plugin","jsx","svg"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pascalduez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-04T21:52:53.000Z","updated_at":"2019-01-05T12:53:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"197455c8-a083-445f-90b6-aaac0f33ad94","html_url":"https://github.com/pascalduez/babel-plugin-jsx-svg","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/pascalduez%2Fbabel-plugin-jsx-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalduez%2Fbabel-plugin-jsx-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalduez%2Fbabel-plugin-jsx-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pascalduez%2Fbabel-plugin-jsx-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pascalduez","download_url":"https://codeload.github.com/pascalduez/babel-plugin-jsx-svg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245938614,"owners_count":20697067,"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":["babel","babel-plugin","jsx","svg"],"created_at":"2024-10-01T15:10:51.454Z","updated_at":"2026-04-16T18:01:53.576Z","avatar_url":"https://github.com/pascalduez.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-jsx-svg\n\n\u003e Tree shackable SVG aliases for JSX\n\n## Installation\n\n```\nnpm install babel-plugin-jsx-svg --save-dev\n```\n\nor\n\n```\nyarn add babel-plugin-jsx-svg --save-dev\n```\n\n## Usage\n\n```json\n{\n  \"plugins\": [\"babel-plugin-jsx-svg\"]\n}\n```\n\n```json\n{\n  \"plugins\": [\n    [\n      \"babel-plugin-jsx-svg\",\n      {\n        \"packageName\": \"somelib\",\n        \"elementName\": \"Svg\",\n        \"elementProp\": \"name\",\n        \"propertyName\": \"icon\",\n        \"componentPrefix\": \"Svg\"\n      }\n    ]\n  ]\n}\n```\n\n## Examples\n\n```js\n/* input */\nimport { Button } from 'somelib';\n\n\u003cButton icon=\"foo\"\u003eClick me\u003c/Button\u003e;\n```\n\n```js\n/* output */\nimport { Button } from 'somelib';\nimport { SvgFoo } from 'somelib';\n\n\u003cButton icon={\u003cSvgFoo /\u003e}\u003eClick me\u003c/Button\u003e;\n```\n\n```js\n/* input */\nimport { Svg } from 'somelib';\n\n\u003cSvg name=\"foo\" /\u003e;\n```\n\n```js\n/* output */\nimport { SvgFoo } from 'somelib';\n\n\u003cSvgFoo /\u003e;\n```\n\n## options\n\n### `packageName`\n\ntype: `String`  \nrequired: `true`\n\n### `elementName`\n\ntype: `String`  \nrequired: `false`  \ndefault: `Svg`\n\n### `elementProp`\n\ntype: `String`  \nrequired: `false`  \ndefault: `name`\n\n### `propertyName`\n\ntype: `String`  \nrequired: `false`  \ndefault: `icon`\n\n### `componentPrefix`\n\ntype: `String`  \nrequired: `false`  \ndefault: `Svg`\n\n## Credits\n\n- [Pascal Duez](https://github.com/pascalduez)\n\n## Licence\n\nbabel-plugin-jsx-svg is [unlicensed](http://unlicense.org/).\n\n[postcss]: https://github.com/postcss/postcss\n[npm-url]: https://www.npmjs.org/package/babel-plugin-jsx-svg\n[npm-image]: http://img.shields.io/npm/v/babel-plugin-jsx-svg.svg?style=flat-square\n[travis-url]: https://travis-ci.org/pascalduez/babel-plugin-jsx-svg?branch=master\n[travis-image]: http://img.shields.io/travis/pascalduez/babel-plugin-jsx-svg.svg?style=flat-square\n[codecov-url]: https://codecov.io/gh/pascalduez/babel-plugin-jsx-svg\n[codecov-image]: https://img.shields.io/codecov/c/github/pascalduez/babel-plugin-jsx-svg.svg?style=flat-square\n[depstat-url]: https://david-dm.org/pascalduez/babel-plugin-jsx-svg\n[depstat-image]: https://david-dm.org/pascalduez/babel-plugin-jsx-svg.svg?style=flat-square\n[license-image]: http://img.shields.io/npm/l/babel-plugin-jsx-svg.svg?style=flat-square\n[license-url]: UNLICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalduez%2Fbabel-plugin-jsx-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpascalduez%2Fbabel-plugin-jsx-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpascalduez%2Fbabel-plugin-jsx-svg/lists"}