Skip to main content
Version: Canary 🚧

📦 plugin-svgr

An SVGR plugin to transform SVG files into React components automatically at build time.

Installation

npm install --save @docusaurus/plugin-svgr
tip

If you use the preset @docusaurus/preset-classic, you don't need to install this plugin as a dependency.

You can configure this plugin through the preset options.

Configuration

Accepted fields:

NameTypeDefaultDescription
svgrConfigobject{}The SVGR config options, forwarded as is

Example configuration

You can configure this plugin through plugin options.

If you use a preset, configure this plugin through the preset options:

docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
svgr: {
svgrConfig: {
/* SVGR config */
},
},
},
],
],
};