1.5.7 • Published 5 years ago

star-based-rating v1.5.7

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

star-based-rating

npm version license

Install

npm install star-based-rating --save

Demo

Props

I have kept minimal configurations. Less configurations Less confusions. You can edit them as well. Also you can show previous stars

<StarBasedRating 
    onSelectRatingStars={this.selectStarHandler.bind(this)} 
    totalStars={10}
    previousStarsToDisplay={3} />   

// onSelectRatingStars:  Method that you want to run after selecting
// totalStars:  Total Number of stars you want to display
// previousStarsToDisplay: Provide existing stars already

How simple is this !! :blush:

Example

import React from 'react';
import ReactDOM from 'react-dom';
import StarBasedRating from 'star-based-rating'

class App extends React.Component {

 selectStarHandler(totalStarsSelected) {
        /* totalStarsSelected param is giving you 
        selected number of stars and what you want to do with it */
    }

    render() {
        return (
            <div>
                <StarBasedRating 
                onSelectRatingStars={this.selectStarHandler.bind(this)} 
                totalStars={10}
                previousStarsToDisplay={3} />
            </div>
        )
    }

}

ReactDOM.render(
  <App />,
  document.getElementById('app')
);

MIT Licensed

:smiley:

1.5.7

5 years ago

1.5.6

5 years ago

1.5.5

5 years ago

1.5.4

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.0.0

5 years ago