GithubHelp home page GithubHelp logo

dxta / react-icon-rating Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dlau/react-icon-rating

0.0 2.0 0.0 10 KB

react component for simple web font backed ratings

Makefile 0.94% JavaScript 99.06%

react-icon-rating's Introduction

react-icon-rating

A react component for simple straightforward rating manipulation

gif:

gif

###Installation

npm install react-icon-rating

###Usage

####Examples showing five stars

Declaration:

var IconRating = require('react-icon-rating')

Font-Awesome 4:

<IconRating toggledClassName="fa fa-star" untoggledClassName="fa fa-star-o"/>

Half stars with Font-Awesome 4: <IconRating toggledClassName="fa fa-star" untoggledClassName="fa fa-star-o" halfClassName="fa fa-star-half-o" />

Glyphicons:

<IconRating toggledClassName="glyphicon glyphicon-star" untoggledClassName="glyphicon glyphicon-star-empty"/>

Others: The component assumes the icon is contained inside an tag, fill the class names in accordingly. Do note, that you can pass additional classes to the IconRating for styling purposes.

####Events

Pass an onChange property to the component. It takes a function of with parameters: function onChange(number){ //number is the rating the user has clicked }

###Browser Compatibility

Out of the box, shouldn't have issues with an exception of the half stars. Calculation for div quadrant may not work in some browsers. Please file an issue!

###License MIT

react-icon-rating's People

Contributors

dlau avatar krismp avatar rwinzhang avatar nishp1 avatar taylorsando avatar

Watchers

James Cloos avatar Minh Duc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.