Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/weknowinc/react-svgloader
- Owner: weknowinc
- Created: 2018-01-16T21:34:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-19T16:34:47.000Z (almost 7 years ago)
- Last Synced: 2024-12-18T20:41:57.175Z (23 days ago)
- Language: JavaScript
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- 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
```