New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-stars-rating

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-stars-rating

A simple react stars rating component

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

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 NameTypeDefaultRequiredDescription
nameStringrating-123456 (timestamp)falsename of the rating used when the component is inside a form
disabledBooleanfalsefalsedisable the stars
insideFormBooleanfalsefalseis the rating stars inside a form
onRatingClickFunction() => falsefalsethe callback used by the parent component. Call when a star is clicked
ratingNumbertruethe rating to display
themeStringorangefalsetheme color

Available Themes

Theme nameTheme 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.

Keywords

FAQs

Package last updated on 18 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc