1.3.1 • Published 5 years ago

react-svg-library v1.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

React Plug-N'-Go Scalable Vector Graphics (SVG) icons library

Scalable Vector Graphics (SVG) icons library for React.js

NPM JavaScript Style Guide

Install

npm install --save react-svg-library

Features

  1. Really easy to include into your DOM, you can modify them in almost any way to fit your application.
  2. Aside from the icons, you can also use Underlines (they are SVG images as well) which can be randomly generated or specific imports, check the showcase and the examples below for more info.

Props

Icons

PropsFunctionality
classNameSVG icon CSS class.
sizeSVG icon size, defaults to 1em.
styleSVG icon CSS styles.
fillSVG icon fill, defaults to currentColor.
strokeSVG icon stroke, defaults to currentColor.
strokeWidthSVG icon stroke, defaults to 0.
iconYou may decide which icon to import by using this prop, all of the icons are showcased in the library with their respective names below the icons.
gradientSome icons have gradient fills (like the calendar-gradient) SVG icon, it is an array of two values, startingColor, finalColor, check the showcase calendar-gradient for an example.
animationFillThe loading SVG animations have different paths that can be filled with different colors, you may check the showcase Loading Animations section for examples.
clipPathFillThe SVG images in the Rating section have what are known as clipPaths, more info here about clipPaths. The clipping path restricts the region to which paint can be applied, meaning the SVG image can be partially filled with color. You may check the examples in the showcase for more information.

Underlines

PropsFunctionality
classNameA class for the underline SVG icon.
styleCSS styles that is applied to the div that wraps the underline, the default style object is: { width: '100%', height: 'auto', display: 'inline-flex', justifyContent: 'center', ...props.style }. Not the spread operator on the props.style, that means that the whole styling won't be reset if you only pass a prop that slightly match the above.
underlineInstead of random underlines, you can choose which ones you like the most, you may take a look at the showcase to see all of the options.
colorColors for a specific underline will only be randomly generated if the randomColor bool prop is passed as true, otherwise the colors will fall back to the default color if an underline is specified or to a random color if the underline is also randomly generated. You may take a look at the showcase to see all of the default colors.
randomColorNeeds to be passed to specific underlines to generate random colors, this prop has no effect on the color if the underline is not specified.

Showcase

Full showcase of all the icons and underlines available.

Basic Usage

The library can be divided in two categories: icons, and underlines.

Icons

import React, { Component } from 'react'

import { Icon } from 'react-svg-library'

class Example extends Component {
  render () {
    return (
      <Icon icon='website' />
    )
  }
}

Underlines

import React, { Component } from 'react'

import { Underline } from 'react-svg-library'

class Example extends Component {
  render () {
    return (
      <Underline />
    )
  }
}

Check out the showcase for more advanced examples.

How to contribute?

You may add more icons by submitting pull requests, or creating issues with the SVG you'd like to see included. I will credit everyone who contributes.

License

MIT © rmolinamir

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.9.0

5 years ago