Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/weknowinc/react-svgloader

ReactJS Component for SVG file loading by Ajax and DOM injection.
https://github.com/weknowinc/react-svgloader

Last synced: about 8 hours ago
JSON representation

ReactJS Component for SVG file loading by Ajax and DOM injection.

Awesome Lists containing this project

README

        

# react-svgloader

This is a ReactJS Component for SVG file loading by Ajax and DOM injection. This component allow us to insert any SVG file specifying a path and adding a class name for css customization.

### Example:

Please refer to the [example](example/src/App.js) file to see it working.

To run the example:
1. Clone the repository
2. Execute in console:
```BASH
cd example
npm install
npm start
```

### General Usage

As you will be able to see in [example](example/src/App.js) in order to use the component we need to importe it as:
```JAVASCRIPT
import SvgLoader from 'react-svgloader';
```

Then, in the render method we can just call it like:

```JAVASCRIPT

```

### Installation

Install this component is easy, just use npm as:
```BASH
npm install react-svgloader
```