SVG Loading and Manipulation Tools for React
Clone or download
Latest commit 81a981f Jul 2, 2018

README.md

react-svgmt CircleCI

react-svgmt (SVG Management Tools for React)

Previously known as react-samy-svg

Installation

npm install react-svgmt

Api

Usage

Import the SvgLoader and SvgProxy elements

import { SvgLoader, SvgProxy } from 'react-svgmt';

Loading and manipulating and SVG

If the path prop is used, then the asset will be fetched from the url.

<SvgLoader path="svg public url here">
  <SvgProxy selector="#Star" stroke={this.state.strokeColor} />
</SvgLoader>

There are two ways to load an SVG file:

  1. From a URL (using the path prop)
  2. From a string with the SVG file contents (using the svgXML prop)

More features, API and examples see https://hugozap.github.io/react-svgmt

Credits

Author:

Special thanks (for contributing to the first version of this library) to:

The ajax loading bits are based on: