Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-svg-star-rating

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-svg-star-rating

The React component for star rating

  • 1.1.42
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
increased by19.93%
Maintainers
1
Weekly downloads
 
Created
Source

A simple, highly customisable SVG star rating component for React

Demo

example

code sandbox

Features:

  • SVG
  • Customisable star shape.
  • Customisable rating increments.
  • Customisable colors.
  • Customisable number of stars.
  • Create read-only stars.

Usage

Via NPM

Install via npm:

npm install react-svg-star-rating

Then require in your project:

import StarRating from 'react-svg-star-rating'

You can then use the following markup in your project:

<StarRating />

Props
PropTypeDescriptionDefault
size?numberThe size of each star30
count?numberThe number of star5
innerRadius?numberThe inner radius of star, this is used to customize star shape. (max: 50)25
outerRadius?numberThe outer radius of star, this is used to customize star shape. (max: 50)50
activeColor?stringThe color of the active portion of star.'#ffd055'
hoverColor?stringThe color of the hover potion of star.'#ffebb7'
emptyColor?stringThe color of empty star''
isHalfRating?booleanWhen set to true, the rating unit is changed to half star.false
roundedCorner?booleanWhether or not to round the star's cornerfalse
handleOnClick?(rating: number) => {}Returns the rating value.undefined
isReadOnly?booleanWhen set to true, the rating cannot to be edited.false
initialRating?numberThe initial rating value.0
containerClassName?stringA css class name to style star container.''
starClassName?stringA css class name to style each star.''

License

Copyright 2019 PRNDcompany

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Keywords

FAQs

Package last updated on 06 Feb 2020

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