@jmshal/react-inline-svg
TypeScript icon, indicating that this package has built-in type declarations

4.0.0-rc.1 • Public • Published

@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 ❤️

Readme

Keywords

none

Package Sidebar

Install

npm i @jmshal/react-inline-svg

Weekly Downloads

67

Version

4.0.0-rc.1

License

MIT

Unpacked Size

30.2 kB

Total Files

7

Last publish

Collaborators

  • jacobmarshall