1.1.0 • Published 8 years ago

ta-react-iconflood v1.1.0

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
8 years ago

Icon Flood Component

React component that quickly shows a row of icons. Usually used for visualisations to allow comparing the amount of things.

Demo 1, Demo 2

Installation

yarn add ta-react-iconflood

Usage

import IconFlood from 'ta-react-iconflood';
let image = require('./path/to/image.png');

/*
    ... more stuff here
 */

class YourComponent extends React.Component {
  render() {

    return (
      <div>
        Just icons:
        <IconFlood count={10} />
        
        With images:
        <IconFlood count={5} imageSrc={image} size='mini' />
      </div>
    )
  }
}

API – 1.1.0

The component uses Semantic UI icons to draw the icons. The icon, color and size properties map to the corresponding Semantic UI classes.

Props

PropertyTypeRequiredDefaultDescription
countnumberyes100The amount of icons to show.
iconstringnouserThe icon to display.
colorstringnogreyThe color of the icons, uses standard Semantic UI colours.
sizestringnolargeThe size of the icons. Use 'mini' or 'tiny' when you use images, otherwise they will be too large.
inlinebool nofalseIf true, puts the icons in a <span> element instead of a <div>. This allows for the composition of several icon types in one block.
imageSrcstringnoN/AUse an URL to an image instead of icons.
additionalClassesstringnoN/AAdditional classes to be passed to the icons – as space delimited strings, just as in normal HTML.
1.1.0

8 years ago

1.0.0

8 years ago