Socket
Socket
Sign inDemoInstall

react-star-rating-meter

Package Overview
Dependencies
10
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-star-rating-meter

a customizable React star rating component with meter


Version published
Weekly downloads
6
decreased by-60%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-star-rating-meter

a customizable React star rating component with or without a meter.

examples: https://dahlki.github.io/react-star-rating-meter/

code for the examples can be viewed in the example folder of this repo.


install:

https://www.npmjs.com/package/react-star-rating-meter

npm install --save react-star-rating-meter

or

yarn add react-star-rating-meter

properties:

all properties are optional (properties will revert to default values)

*note: color values can be any css valid color value; if you want a color property to be transparent use an empty string: ""

*note: if using a custom svg, only one 'path' can be given and also, the 'viewBox' value is required.

PropDataTypeDefaultDescription
readOnlybooleanfalseindicate whether the star rating is editable by the user or read only
numOfStarsnumber5number of stars
initialRatingnumber0set initial value
heightnumber (px)30height of the meter and highlight in pixels
lengthnumber (px)250length of the meter in pixels
showMeterbooleantrueindicate whether to show the meter or just show stars/svgs
labelstringStarRatingan option to label the component to easily get and store the rating value
meterEmptyColorstring#F0E7E7set the default/empty meter color
meterSelectColorstring#311E24set the select/active meter color
meterBorderColorstring#785A65set the meter border color
meterBorderSizenumber (px)3set the meter border thickness
meterBorderStylestringsolidset the border style; can be any css valid border style
highlightColorstring#FFD6DDset the highlight color of the selected/active star
highlightWidthnumber (px)30set the width of the highlight (height is determined by the height prop, the height of the meter)
starEmptyColorstring#AF9EA3set the default/empty color of the stars/svgs
starSelectColorstring#D60429set the selected/active color of the stars/svgs
starSizenumber (px)18size of the stars
getRatingfunctionundefinedset a function to be called upon clicking a star; the arguments passed are: (rating, label, event)
onHoverfunctionundefinedset a function to be called upon hovering a star; the arguments passed are: (rating, label, event)
svgobject = {path: string, viewBox: string}(if none indicated, the svg is a star)an object that must have both path and viewBox properties; if either one is missing, defaults to a star

Keywords

FAQs

Last updated on 14 Oct 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc