2.13.0 • Published 6 years ago

fyndiq-icons v2.13.0

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

fyndiq-icons npm

A set of icons for Fyndiq

Installation

The component can be installed through NPM:

npm i -S fyndiq-icons

Usage

To see the name of the icons in the set, please visit the demo

import React from 'react'
import { Pencil, Checkmark } from 'fyndiq-icons'

// Normal usage
<Checkmark />

// Change the color
import colors from 'fyndiq-style-colors'
<Pencil color={colors.blue} />

To change the color of the Icon in CSS, do the following:

/*
  It is important to always set both the fill
  and stroke to a specified color.
*/
.myIcon {
  fill: red;
  stroke: red;
}
import { Magnifier } from 'fyndiq-icons'

<Magnifier className="myIcon" />

API

All icons have the following props:

NameTypeDescriptionDefault value
classNameStringAn optional classname to put on the root SVG''
colorStringSet the color of the icon in SVG

Additionnaly, some icons provide special props:

Arrow

NameTypeDescriptionDefault value
orientationStringSpecifies the orientation of the arrow. One of up, down, right or leftleft

Star

NameTypeDescriptionDefault value
fullNumberDescribes how "full" the star is. Usefull to show half-stars. 1 is full, 0 is empty.1 (full)
colorStringIn the case of the star, this attribute corresponds to the color of the full part of the star.
colorEmptyStringColor of the empty part of the star

Developpment info

Add a new icon

To add a new icon to fyndiq-icons, you need to first clean it up, using Inkscape/Illustrator and optimize it using SVGOMG.

Then, use the following template for your new file

import React from 'react'
import PropTypes from 'prop-types'

import SvgWrapper from './svg-wrapper'

/* Rename NewIcon to something more specific */
const NewIcon = ({ className, color }) => (
  <SvgWrapper className={className} viewBox="*** YOUR ICON'S VIEWBOX HERE ***">
    {/* Content of the SVG*/}
  </SvgWrapper>
)

NewIcon.propTypes = SvgWrapper.propTypes
NewIcon.defaultProps = SvgWrapper.defaultProps

export default NewIcon

The part {/* Content of the SVG*/} should represent the different <path>s of your SVG. Each of them should have a prop fill or stroke set to {color}, and the other one set to none. This is very important and enables both CSS and JS coloring.

2.13.0

6 years ago

2.12.0

6 years ago

2.11.0

6 years ago

2.10.0

6 years ago

2.9.1

6 years ago

2.9.0

6 years ago

2.8.0

6 years ago

2.7.0

6 years ago

2.6.0

6 years ago

2.5.1

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.0

7 years ago

2.2.4

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago