8.1.0 • Published 2 years ago

@svgr/core v8.1.0

Weekly downloads
4,048,928
License
MIT
Repository
github
Last release
2 years ago

@svgr/core

Build Status version MIT License

Node API of SVGR.

npm install @svgr/core

Usage

import { transform } from '@svgr/core'

const svgCode = `
<svg xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <rect x="10" y="10" height="100" width="100"
    style="stroke:#ff0000; fill: #0000ff"/>
</svg>
`

transform(svgCode, { icon: true }, { componentName: 'MyComponent' }).then(
  (jsCode) => {
    console.log(jsCode)
  },
)

Use svgr.sync(code, config, state) if you would like to use sync version.

Plugins

By default @svgr/core doesn't include any plugin, if you want them, you have to install them and include them in config.

svgr(svgCode, {
  plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx', '@svgr/plugin-prettier'],
}).then((jsCode) => {
  console.log(jsCode)
})

License

MIT

@svgr/webpackparcel-plugin-svgr-patchedparcel-plugin-svgrsvg-library-component-creator@reactpreview/foundation@zenclabs/reactpreviewpixelstream-cli@lejdosd/celestial-form@infinitebrahmanuniverse/nolb-_svplop-pack-gatsby-starter@everything-registry/sub-chunk-885af-webpack-sudoku356-test@porosjs/bundler-vite@porosjs/bundler-webpack@porosjs/preset-umisvg-react-iconsvg-plugin-vitesvgr-loadersvgr-rollup-infernosvgr-webpack-infernosvg-icon-system-buildersvg2rnsvglbwodax-af-webpackxcim-codesandboxwsksvgsui-iconssun-iconsstickerbombsvg-component-library-creatorsvg-component-packagesvg-component-vite-pluginsvg-componentifysvg-to-react-nativesvg-to-react-tsxsvg-to-icon-clivpressifyvite-plugin-react-svgvite-plugin-react-svgrvite-plugin-react-iconsvite-plugin-react-rich-svgvite-plugin-svg-reactviteshotvite-plugin-svgrvite-plugin-svgr-componentvite-plugin-svgr-default-export-option@compassion-gds/react-web@commercetools-frontend/mc-scripts@czk1997/react-undraw@deploysentinel/jest-rtl-debugger@dr.pogodin/babel-preset-svgr@camol/vite-plugin-react-svg@buttery/icons@buttery/tools@bendews/aws-react-icons@rsbuild/plugin-svgr@rubeniskorg/esbuild-scripts@rntest/iconislandjsisland-ssgjest-previewjs-next-optimized-images@fotoz/react-components@stazg/ordiosymbol-sync@nexusmutual/logosuspk-ui@ariajdev/company-colored-icon@arzoka/svg-component-package@andreisergiu98/next-optimized-images@andylacko/vite-svg-react-loader@atlaspack/transformer-svg-react@atls/code-runtime@atls-ui-generators/icons@arco-plugins/vite-plugin-svgr@assetbox/plugin-react-icon@adobe/parliament-markdown-cleaner@airbridge/esbuild-plugin-svgr@backstage/cli@bedu-tmp/iconography@bedu-tmp/illustrations@blackplate/react-native-svg-processor@blorajs/af-webpack@carforyou/assets@clevercanyon/dev-deps@42world/design-core@achmadk/vite-plugin-svgr@codesuperman/test-islandjs@deal/parcel-plugin-svgr@dfatwork-pkgs/backstage-cli@consta/standxrn-svgrunplugin-svgr@figma-export/output-components-as-svgr@fishx/bundle-webpack@fishx/bundler-vite@fishx-vite/bundler-vite@fishx-vite/preset-fishx@gravity-ui/app-builder@grexie/pages-image-loader
8.1.0

2 years ago

8.0.0

2 years ago

7.0.0

2 years ago

6.5.0

3 years ago

6.4.0

3 years ago

6.5.1

3 years ago

6.3.0

3 years ago

6.3.1

3 years ago

6.2.1

3 years ago

6.2.0

4 years ago

6.0.0-alpha.3

4 years ago

6.0.0-alpha.4

4 years ago

6.1.0

4 years ago

6.0.0

4 years ago

6.1.2

4 years ago

6.1.1

4 years ago

6.0.0-alpha.2

4 years ago

6.0.0-alpha.1

4 years ago

6.0.0-alpha.0

4 years ago

5.5.0

5 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

6 years ago

5.0.0

6 years ago

4.3.3

6 years ago

4.3.2

6 years ago

4.3.1

6 years ago

4.3.0

6 years ago

4.2.0

6 years ago

4.1.0

7 years ago

4.0.3

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.4.1

7 years ago

2.4.0

7 years ago

2.2.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago