2.1.2 • Published 2 years ago

react-svg-star-rating v2.1.2

Weekly downloads
2,053
License
MIT
Repository
github
Last release
2 years ago

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
unit?'full' | 'half' | 'float'The unit of star'full'
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''
roundedCorner?booleanWhether or not to round the star's cornertrue
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.''

version

v1

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.
2.1.2

2 years ago

2.1.1

3 years ago

2.1.0-alpha.3

3 years ago

2.1.0-alpha.2

3 years ago

2.1.0-alpha.1

3 years ago

2.1.0-beta.1

4 years ago

2.1.0-beta.0

4 years ago

1.1.5

4 years ago

1.1.43

4 years ago

1.1.42

4 years ago

1.1.41

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.11

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago