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 2 months ago
JSON representation
ReactJS Component for SVG file loading by Ajax and DOM injection.
- Host: GitHub
- URL: https://github.com/weknowinc/react-svgloader
- Owner: weknowinc
- Created: 2018-01-16T21:34:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-19T16:34:47.000Z (over 8 years ago)
- Last Synced: 2025-11-21T20:03:52.796Z (8 months ago)
- Language: JavaScript
- Size: 46.9 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```