1.0.0 • Published 7 years ago

pre-rating v1.0.0

Weekly downloads
7
License
-
Repository
github
Last release
7 years ago

Pre Rating

Pre-Rating is a composition that offers rating with font-awesome icons.

NPM

npm version

Installation

npm install --save pre-rating

For More Example

Live Demo

Basic Usages

 <Rating currentValue={8}
         onChange={this.__handleChange}
         onMouseOver={this.__handleMouseOver}
 />
 <Rating size={2}
  currentValue={4.5}
  onChange={this.__handleChange}
  disabled
 />

--- With another font-awesome icons ---

  <Rating size={1}
          iconCount={5}
          initialIcon="fa-heart-o"
          selectedIcon="fa-heart"
          style={{color: "red"}}
          onChange={this.__handleChange}
   />

Rating Props

NameTypeDefaultRequiredDescription
sizenumber0falseSize of Rating icons. Possible Values : 0,1,2,3,4
currentValuenumber-falseDirect selected value.
iconCountnumber10falseCount of icons.
initialIconstringfa-star-ofalseInitial icon type (Works with font-awesome icons like "fa-star-o").
selectedIconstringfa-starfalseSelected icon type (Works with font-awesome icons like "fa-star").
disabledboolfalsefalseDisable icons.
onChangefunc-falseChange event for the component (Returns (clickedKey)).
onMouseOverfunc-falseMouseOver event for the component (Returns (hoveredKey)).
styleobject-falseStyle of Rating icons.
labelstring-falseLabel for Rating component.

Quick Start

1. Get the latest version

You can start by cloning the latest version of pre-rating.

2. Run npm install

This will install both run-time project dependencies and developer tools listed in package.json file.

3. How to start project in Development Mode

This will start the development server and serve site application.

$ npm start

Open Browser and enter http://localhost:3000 (default)

How to Build for Production

If you need just to build the app (without running a dev server), simply run:

$ npm run build

How to Build for Site

If you need just to build the app (without running a dev server), simply run:

$ npm run site

License

The MIT License (MIT) Copyright (c) 2017 Fatih Totrakanlı