Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Nov 14, 2024
1 parent 992ea81 commit 430494c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
3 changes: 3 additions & 0 deletions website/docs/api/plugins/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ These plugins will add a useful behavior to your Docusaurus site.

- [@docusaurus/plugin-debug](./plugin-debug.mdx)
- [@docusaurus/plugin-sitemap](./plugin-sitemap.mdx)
- [@docusaurus/plugin-svgr](./plugin-svgr.mdx)
- [@docusaurus/plugin-rsdoctor](./plugin-rsdoctor.mdx)
- [@docusaurus/plugin-pwa](./plugin-pwa.mdx)
- [@docusaurus/plugin-client-redirects](./plugin-client-redirects.mdx)
- [@docusaurus/plugin-ideal-image](./plugin-ideal-image.mdx)
- [@docusaurus/plugin-google-analytics](./plugin-google-analytics.mdx)
- [@docusaurus/plugin-google-gtag](./plugin-google-gtag.mdx)
- [@docusaurus/plugin-google-tag-manager](./plugin-google-tag-manager.mdx)
55 changes: 55 additions & 0 deletions website/docs/api/plugins/plugin-svgr.mdx
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 */
},
};
```
3 changes: 3 additions & 0 deletions website/docs/using-plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ The classic preset is shipped by default to new Docusaurus websites created with
- [`@docusaurus/plugin-google-tag-manager`](./api/plugins/plugin-google-tag-manager.mdx)
- [`@docusaurus/plugin-google-analytics`](./api/plugins/plugin-google-analytics.mdx) (**deprecated**)
- [`@docusaurus/plugin-sitemap`](./api/plugins/plugin-sitemap.mdx)
- [`@docusaurus/plugin-svgr`](./api/plugins/plugin-svgr.mdx)

The classic preset will relay each option entry to the respective plugin/theme.

Expand All @@ -171,6 +172,8 @@ export default {
pages: {},
// Will be passed to @docusaurus/plugin-sitemap (false to disable)
sitemap: {},
// Will be passed to @docusaurus/plugin-svgr (false to disable)
svgr: {},
// Will be passed to @docusaurus/plugin-google-gtag (only enabled when explicitly specified)
gtag: {},
// Will be passed to @docusaurus/plugin-google-tag-manager (only enabled when explicitly specified)
Expand Down

0 comments on commit 430494c

Please sign in to comment.