# jacobmarshall-react-inline-svg

> React Component to load and inline SVG images, allowing you to target and style them using CSS

Latest version **3.0.1** (published 2018-01-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install jacobmarshall-react-inline-svg
pnpm add jacobmarshall-react-inline-svg
yarn add jacobmarshall-react-inline-svg
bun add jacobmarshall-react-inline-svg
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2018-01-20 |
| First published | 2016-10-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jacobmarshall |

## Links

- npm: https://www.npmjs.com/package/jacobmarshall-react-inline-svg
- npm.io page: https://npm.io/package/jacobmarshall-react-inline-svg

## Recent versions

- 3.0.1 (latest) — 2018-01-20
- 3.0.0 — 2018-01-20
- 2.0.3 — 2017-10-03
- 2.0.2 — 2017-09-30
- 2.0.1 — 2016-10-31
- 2.0.0 — 2016-10-31

## README

jacobmarshall-react-inline-svg
==============================

React Component to load and inline SVG images, allowing you to target and style SVGs using CSS.


Features
--------
- Easy to use, just add `InlineSVG` components
- Loads SVGs automatically using a `XMLHttpRequest`
- Loads each SVG exactly once, and caches them for repeated use
- Can preload SVGs in advance using `InlineSVG.cache`

Installation
------------

```
$ npm i --save jacobmarshall-react-inline-svg
```


Usage
-----

Include the component:
```html
<script src="https://unpkg.com/jacobmarshall-react-inline-svg@2.0/dist/react-inline-svg.js"></script>
```


Or...
```js
import InlineSVG from 'jacobmarshall-react-inline-svg';
```


Render an inline SVG:

```xml
<InlineSVG src="/path/to/your.svg" className="css-class" />
```


Pre-loading SVGs
----------------

```javascript
InlineSVG.cache.load("/path/to/your.svg");
```


Building from Source
--------------------

To re-build this after making changes in `src`, simply run:

```
$ gulp
```

---
_Source: https://npm.io/package/jacobmarshall-react-inline-svg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
