@svgr/babel-plugin-add-jsx-attribute

Add JSX attribute

Usage no npm install needed!

<script type="module">
  import svgrBabelPluginAddJsxAttribute from 'https://cdn.skypack.dev/@svgr/babel-plugin-add-jsx-attribute';
</script>

README

@svgr/babel-plugin-add-jsx-attribute

Install

npm install --save-dev @svgr/babel-plugin-add-jsx-attribute

Usage

.babelrc

{
  "plugins": [
    [
      "@svgr/babel-plugin-add-jsx-attribute",
      {
        "elements": ["svg"],
        "attributes": [
          {
            "name": "width",
            "value": "200",
            "spread": false,
            "literal": false,
            "position": "end"
          }
        ]
      }
    ]
  ]
}

License

MIT