Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Raty | 2,332 | 2 months ago | 60 | mit | JavaScript | |||||
:star2: Raty - A Star Rating Plugin | ||||||||||
Laravel Love | 1,014 | 11 | 2 | a month ago | 51 | February 23, 2022 | 7 | mit | PHP | |
Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react? | ||||||||||
Laravel Acquaintances | 677 | 2 days ago | 28 | December 14, 2021 | 16 | mit | PHP | |||
This package gives Eloquent models the ability to manage friendships (with groups), followships along with Likes, favorites..etc. | ||||||||||
Django Ratings | 399 | 38 | 6 years ago | 8 | July 11, 2012 | 36 | bsd-2-clause | Python | ||
Pluggable rating fields in Django. | ||||||||||
Tgram | 332 | 3 years ago | 4 | October 25, 2018 | 38 | gpl-3.0 | Go | |||
typegram: open source publishing platform | ||||||||||
Data Movies | 191 | 3 years ago | 6 | Ruby | ||||||
Download data from IMDB movies and parse into useful form | ||||||||||
Laravel Rating | 137 | 1 | 2 years ago | 8 | April 22, 2021 | mit | PHP | |||
Laravel package that allows you to rate, like & dislike and vote(+1,-1) your models with a simple and clear ways | ||||||||||
Django Updown | 127 | 11 | 5 years ago | 16 | February 27, 2018 | 5 | other | Python | ||
Simple youtube like up and down rating app for Django. | ||||||||||
Starratingview | 72 | 6 | 7 years ago | 4 | April 08, 2016 | mit | Objective-C | |||
Star rating view, often used in vote. Easy to use, and flexible configurations. | ||||||||||
Yii2 Vote | 67 | 3 | 5 years ago | 14 | May 19, 2018 | 5 | bsd-3-clause | PHP | ||
Provides voting for any model :+1: :-1: |
rater-js is a star rating widget for the browser.
npm install rater-js --save
rater-js can be used with amd, commonjs or without any module loader using global scope.
In your html create an element that acts as the placeholder for the widget.
<div id="rater"></div>
Directly reference the js from the module
<!--Add js before end body tag-->
<script src="node-modules/rater-js/index.js"></script>
The widget will be available globally as "raterJs" on the window object.
Just require the module.
var rater = require("rater-js");
Lastly we can use the widget like this:
var myRater = rater({element: document.querySelector("#rater"), rateCallback: function rateCallback(rating, done) {
//make async call to server however you want
//in this example we have a 'service' that rate and returns the average rating
myDataService.rate(rate).then(function(avgRating) {
//update the avarage rating with the one we get from the server
myRater.setRating(avgRating);
//we could disable the rater to prevent another rating
//if we dont want the user to be able to change their mind
myRater.disable();
//dont forget to call done
done();
}, function(error) {
//handle the error
//dont forget to call done
done();
});
}});
Css will be injected at runtime, but you can override the css to get the look you want.
//change the whole image used as the star. Make sure to set starSize in options if not 16px.
//first image is for the 'off' mode
.star-rating {
background: url("myStar_off.svg") !important;
}
//add style for 'on' mode
.star-rating .star-value{
background: url("myStar_on.svg") !important;
}
Property | Description |
---|---|
element | HtmlElement. Required. |
rateCallback | Function. Triggered when star i clicked. |
max | Number. Number of stars to show. |
showToolTip | true/false. If set to true, show tooltip when hover the stars. |
starSize | Number. Width and height of the star image. |
disableText | Text to show when disabled. |
ratingText | Text to show when hover over stars. Text {rating} {maxRating}. |
isBusyText | Displayed while user is rating but done not called yet. |
readOnly | true/false. If set to true, will disable the rater. |
step | Number. Set a precision between 0 and 1 for the rating. |
reverse | true/false. If set to true, the ratings will be reversed. |
disable(): //Disable the widget
enable(): //Enable the widget
setRating(rating:number): //Set the rating
getRating(): //Get the average rating
dispose(); //Removes event handlers
clear(); //Clears the rating
element; //Get the element used by rater js