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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-stars-rating

v0.0.5

Published

A simple react stars rating component

Downloads

22

Readme

react-stars-rating

NPM

react-stars-rting is a react component that allows you to add ratings to your applications.

Usage

Install

$ npm install react-stars-rating --save

or

$ yarn add react-stars-rating

Usage

import StarsRating from 'react-stars-rating';

Example

import React from 'react';
import StarsRating from 'react-stars-rating';

class MyComponent extends React.Component {
  render() {
    return (
      <StarsRating rating={3} />
    );
  }
}

React.render(<MyComponent />, document.getElementById('app'));

PropTypes

| Prop Name | Type | Default | Required | Description | |---------------|----------|---------------------------|----------|------------------------------------------------------------------------| | name | String | rating-123456 (timestamp) | false | name of the rating used when the component is inside a form | | disabled | Boolean | false | false | disable the stars | | insideForm | Boolean | false | false | is the rating stars inside a form | | onRatingClick | Function | () => false | false | the callback used by the parent component. Call when a star is clicked | | rating | Number | | true | the rating to display | | theme | String | orange | false | theme color |

Available Themes

| Theme name | Theme color | |----------------|--------------------------------------------------------------------| | white | #FFFFFF #FFFFFF | | snow | #F9FAFC #F9FAFC | | darkSnow | #EFF2F7 #EFF2F7 | | extraDarkSnow | #E5E9F2 #E5E9F2 | | silver | #8492A6 #8492A6 | | slate | #3C4858 #3C4858 | | steel | #273444 #273444 | | black | #1F2D3D #1F2D3D | | smoke | #E0E6ED #E0E6ED | | darkSmoke | #D3DCE6 #D3DCE6 | | extraDarkSmoke | #C0CCDA #C0CCDA | | lightBlue | #85D7FF #85D7FF | | blue | #1FB6FF #1FB6FF | | darkBlue | #009EEB #009EEB | | lightPurple | #A389F4 #A389F4 | | purple | #7E5BEF #7E5BEF | | darkPurple | #592DEA #592DEA | | lightPink | #FF7CE5 #FF7CE5 | | pink | #FF49DB #FF49DB | | darkPink | #FF16D1 #FF16D1 | | lightOrange | #FF9E7C #FF9E7C | | orange | #FF7849 #FF7849 | | darkOrange | #FF5216 #FF5216 | | lightGreen | #29EB7F #29EB7F | | green | #13CE66 #13CE66 | | darkGreen | #0F9F4F #0F9F4F | | lightYellow | #FFD55F #FFD55F | | yellow | #FFC82C #FFC82C | | darkYellow | #F8B700 #F8B700 | | info | #1FB6FF #1FB6FF | | success | #13CE66 #13CE66 | | danger | #FF4949 #FF4949 | | warning | #FFC82C #FFC82C |

Mentions

This component is inspired by the following codepen by Joseph Fusco and also many thanks to the guys from Marvel for having such a perfect color scheme.