# docz-plugin-svgr

> Use svgr as loader for svg images

Latest version **0.11.0** (published 2018-09-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install docz-plugin-svgr
pnpm add docz-plugin-svgr
yarn add docz-plugin-svgr
bun add docz-plugin-svgr
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.11.0 |
| Published | 2018-09-02 |
| First published | 2018-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | pedronauck |

## Links

- npm: https://www.npmjs.com/package/docz-plugin-svgr
- npm.io page: https://npm.io/package/docz-plugin-svgr

## Dependencies (2)

- [docz-core](https://npm.io/package/docz-core.md) ^0.11.0
- [@svgr/webpack](https://npm.io/package/@svgr/webpack.md) ^2.2.1

## Recent versions

- 0.11.0 (latest) — 2018-09-02
- 0.10.0-beta.0 (beta) — 2018-08-10
- 0.10.3 — 2018-08-16
- 0.10.2 — 2018-08-13
- 0.10.1 — 2018-08-13
- 0.10.0 — 2018-08-13
- 0.9.6 — 2018-08-06
- 0.9.4 — 2018-08-04
- 0.9.4-beta.1 — 2018-08-04
- 0.9.4-beta.0 — 2018-08-04
- 0.9.3 — 2018-08-03
- 0.9.2 — 2018-08-02
- 0.9.1 — 2018-08-02
- 0.9.0 — 2018-08-02
- 0.9.0-beta.1 — 2018-08-01
- … 1 more at https://npm.io/package/docz-plugin-svgr/versions

## README

# docz-plugin-svgr

This plugin allow you to use [svgr](https://github.com/smooth-code/svgr/tree/master/packages/webpack) as loader for svg images together with default `file-loader`

## Install

```bash
$ yarn add docz-plugin-svgr
```

## Usage

Just import the plugin and add it on your `doczrc.js`

```js
import { svgr } from 'docz-plugin-svgr'

export default {
  plugins: [svgr()]
}
```

Then just use named imports to import using svgr

```jsx
import starUrl, { ReactComponent as Star } from './star.svg'

const App = () => (
  <div>
    <img src={starUrl} alt="star" />
    <Star />
  </div>
)
```

## Custom options

If you want to pass [custom options](https://github.com/smooth-code/svgr/tree/master/packages/webpack#passing-options) for `@svgr/webpack` just pass as first argument of the functio

```js
import { svgr } from 'docz-plugin-svgr'

export default {
  plugins: [svgr({ native: true })]
}
```

---
_Source: https://npm.io/package/docz-plugin-svgr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
