4.0.0-rc.1 • Published 7 years ago

@jmshal/react-inline-svg v4.0.0-rc.1

Weekly downloads
118
License
MIT
Repository
github
Last release
7 years ago

@jmshal/react-inline-svg

A simple and lightweight React component for loading SVG files so they can be styled with CSS.

Installation

$ npm install --save @jmshal/react-inline-svg

Basic usage

import { InlineSVG } from '@jmshal/react-inline-svg';

// ...

<InlineSVG
  src={require('./path/to/icon.svg')}
  className={css.Example}
/>

Preloading

import { preload } from '@jmshal/react-inline-svg';

preload('./path/to/icon.svg')
  .then(() => console.log('icon.svg has been preloaded'));

License

MIT ❤️