@svgr/plugin-jsx
Transform SVG into JSX
Last updated 2 years ago by neoziro .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @svgr/plugin-jsx 
SYNC missed versions from official npm registry.

@svgr/plugin-jsx

Build Status Version MIT License

Transforms SVG into JSX.

Install

npm install --save-dev @svgr/plugin-jsx

Usage

.svgrrc

{
  "plugins": ["@svgr/plugin-jsx"]
}

How does it work?

@svgr/plugin-jsx consists in three phases:

Applying custom transformations

You can extend the Babel config applied in this plugin using jsx.babelConfig config path:

// .svgrrc.js

module.exports = {
  jsx: {
    babelConfig: {
      plugins: [
        // For an example, this plugin will remove "id" attribute from "svg" tag
        [
          '@svgr/babel-plugin-remove-jsx-attribute',
          {
            elements: ['svg'],
            attributes: ['id'],
          },
        ],
      ],
    },
  },
}

Several Babel plugins are available:

If you want to create your own, reading Babel Handbook is a good start!

License

MIT

Current Tags

  • 8.1.0                                ...           latest (a year ago)
  • 6.0.0-alpha.4                                ...           next (3 years ago)

36 Versions

  • 8.1.0                                ...           a year ago
  • 8.0.1                                ...           2 years ago
  • 8.0.0                                ...           2 years ago
  • 7.0.0                                ...           2 years ago
  • 6.5.1                                ...           2 years ago
  • 6.5.0                                ...           2 years ago
  • 6.4.0                                ...           2 years ago
  • 6.3.1                                ...           2 years ago
  • 6.3.0                                ...           2 years ago
  • 6.2.1                                ...           3 years ago
  • 6.2.0                                ...           3 years ago
  • 6.1.2                                ...           3 years ago
  • 6.1.0                                ...           3 years ago
  • 6.0.0                                ...           3 years ago
  • 6.0.0-alpha.4                                ...           3 years ago
  • 6.0.0-alpha.3                                ...           3 years ago
  • 6.0.0-alpha.2                                ...           3 years ago
  • 6.0.0-alpha.1                                ...           3 years ago
  • 6.0.0-alpha.0                                ...           3 years ago
  • 5.5.0                                ...           4 years ago
  • 5.4.0                                ...           5 years ago
  • 5.3.1                                ...           5 years ago
  • 5.3.0                                ...           5 years ago
  • 5.2.0                                ...           5 years ago
  • 5.0.1                                ...           5 years ago
  • 5.0.0                                ...           5 years ago
  • 4.3.3                                ...           5 years ago
  • 4.3.2                                ...           5 years ago
  • 4.3.1                                ...           5 years ago
  • 4.3.0                                ...           5 years ago
  • 4.2.0                                ...           6 years ago
  • 4.1.0                                ...           6 years ago
  • 4.0.3                                ...           6 years ago
  • 4.0.2                                ...           6 years ago
  • 4.0.1                                ...           6 years ago
  • 4.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE