-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
sidebar_position: 7 | ||
slug: /api/plugins/@docusaurus/plugin-svgr | ||
--- | ||
|
||
# 📦 plugin-svgr | ||
|
||
import APITable from '@site/src/components/APITable'; | ||
|
||
An [SVGR](https://react-svgr.com/) plugin to transform SVG files into React components automatically at build time. | ||
|
||
## Installation {#installation} | ||
|
||
```bash npm2yarn | ||
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](../../using-plugins.mdx#docusauruspreset-classic). | ||
|
||
::: | ||
|
||
## Configuration {#configuration} | ||
|
||
Accepted fields: | ||
|
||
```mdx-code-block | ||
<APITable> | ||
``` | ||
|
||
| Name | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| `svgrConfig` | `object` | `{}` | The [SVGR config options](https://react-svgr.com/docs/options/), forwarded as is | | ||
|
||
```mdx-code-block | ||
</APITable> | ||
``` | ||
|
||
### Example configuration {#ex-config} | ||
|
||
You can configure this plugin through plugin options. | ||
|
||
```js config-tabs | ||
// Preset Options: svgr | ||
// Plugin Options: @docusaurus/plugin-svgr | ||
|
||
const config = { | ||
svgrConfig: { | ||
/* SVGR config */ | ||
}, | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters