Google Material Rating Plugin With jQuery - star.rating.js

Google Material Rating Plugin With jQuery - star.rating.js
File Size: 10.3 KB
Views Total: 2218
Last Update:
Publish Date:
Official Website: Go to website
License: MIT

Just another jQuery plugin used to generate a simple star rating control using Google's Material Icons. The plugin automatically converts any DIV element into a hidden input for the rating control.

How to use it:

1. Load the Google Material Icons from a CDN:

<link rel="stylesheet" href="">

2. You can also import the Google Material Icons like this:

@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: local('Material Icons'), local('MaterialIcons-Regular'), url( format('woff2'), url( format('woff');

3. Create a DIV element for the star rating control.

<div class="rating"></div>

4. Load jQuery library and the in the webpage when needed.

<script src="//"></script>
<script src=""></script>

5. Call the function on the DIV element to render a basic star rating control on the webpage.


6. Set the maximum number of stars you want to use.

  max: 5

7. Specify the attributes for the hidden input field.

  fieldName : 'rating',
  fieldId : 'rating',

8. Use the other icons instead of the default star icon.

  icon : 'star'

This awesome jQuery plugin is developed by acv629. For more Advanced Usages, please check the demo page or visit the official website.