npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-jrate

v0.1.2

Published

Generate SVG based Rating with various customized fancy features using ReactJS

Readme

react-jrate - React based Rating Component

=======================================

This react component helps to generate SVG based RATING with various fancy features. Download and include this component in your html file.

Demo Page

Demo

Twitter Demo

Installation

You can install using npm package manager.

npm install react-jrate --save

JSFiddle Working Example

Including it on your page

You can install react-jrate component from NPM.

<script type="text/javascript" src="lib/react-jrate.js"></script>

  var ReactRating = require('react-jrate');
	//es6 style
	import React from 'react'
	import ReactRating from '../lib/react-jrate.js'

Basic Usage

<div id="jRate"></div>
React.render(<ReactRating  id="jrate"/>,document.getElementById('jrate'));

Features

Start Color and End Color

Set your favourite start and end color. By giving value in the form of hex value, rgb value or standard color name. We can use one color format also by giving same start and end color.

var newSettings = {
  startColor: "cyan",
  endColor: "blue"
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Initial Value

Set your own default initial value.

var newSettings = {
  rating:2
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Width and Height

We can customize our own value for width and height.

var newSettings = {
  width: 70,
  height: 70
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Shape

We can chooose shape from available list. If you need more shapes, raise feature request in github. Available shapes are STAR, RECTANGLE, SQUARE, CIRCLE, RHOMBUS, TRIANGLE, TWITTER, BASKET.

var newSettings = {
  shape: 'BASKET'
});
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Width and Height Growth

Make the shapes from smaller to bigger. We can use growth field to make this happen.

var newSettings = {
  widthGrowth: 0.2,
  heightGrowth: 0.2
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Count

Number of shapes was decided by the count parameter. We can customize own numeric value for it.

var newSettings = {
  count: 10
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Background Color

Set your favourite background color. By giving value in the form of hex value, rgb value or standard color name.

var newSettings = {
  backgroundColor: 'black'
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Color Transparency

Set transparency value between 0 and 1.

var newSettings = {
  transparency: 0.5
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Gap

We can set our own gap between two shapes. We can customize our own values in it.

var newSettings = {
  shapeGap: '10px'
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Opacity

Set opacity value.

var newSettings = {
  opacity: 0.3
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Minimum and Maximum Value

Set a desired minimum and maximum value.

var newSettings = {
  min: 10,
  max: 15
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Precision

Set the precision value.

var newSettings = {
  precision: 0
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Stroke Width

Set the stroke width for STAR, CIRCLE, RECTANGLE, RHOMBUS, TRIANGLE only.

var newSettings = {
  strokeWidth: '25px'
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Horizontal

We can set a boolean variable to make horizontal or vertical. And, set a boolean value for reverse.

var newSettings = {
  horizontal: false
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

Reverse

We can set a boolean variable to make reverse or not.

var newSettings = {
  reverse: true
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

ReadOnly

Set the readonly value.

var newSettings = {
  readOnly: true
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

onChange

Write your own methods to do own action when the rating value change action occurs.

var newSettings = {
  onChange: function(rating) {
    $('#demo-onchange-value').text("Your Rating: "+rating);
  }
});
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

onSet

Write your own methods to do own action when the rating value click or set action occurs.

var newSettings = {
  onSet: function(rating) {
    $('#demo-onset-value').text("Selected Rating: "+rating);
  }
};
React.render(<ReactRating settings={newSettings} id="jrate"/>,document.getElementById('jrate'));

License

This plugin is licensed under the MIT license.

Copyright (c) 2015 Senthil Porunan