1.0.4 • Published 2 years ago

react-native-rating-stars v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

react-native-rating-stars

react-native-rating-stars is a versatile react native star review component with custom star sizes, star count, star spacing, and interactivity clickable.

Table of Contents

  1. Installation
  2. Usage
  3. Props

Installation

npm install react-native-rating-stars --save

Dependencies

Since we used React Native Vector icons so you need to install react-native-vector-icons Istallation Resource: https://github.com/oblador/react-native-vector-icons#installation

Usages

Example 01 (Show as well as get give rating)

import RatingStar from "react-native-rating-stars"

const getRatingNumber = (ratingNumber) => {
  console.log(ratingNumber)
}

<RatingStar
  numberOfStar={5}
  ratingState={3}
  color="#006994"
  size={20}
  isClickable={true}
  getRatingNumber={getRatingNumber}
/>

Example 02 (Only show rating)

import RatingStar from "react-native-rating-stars"

<RatingStar numberOfStar={5} ratingState={3} color="#006994" size={20} />

Props

PropTypeDescriptionRequiredDefault
numberOfStarintHow many star do you want to showNo5
ratingStateint3No0
colorstringcolor of star like 'red' or color code or rgba etcNo#006994
sizeintsize of starsNo25
isClickablebooleanwant to give starNofalse
getRatingNumberfunctionget gave rating numberNonull

Contributing

Pull Requests for new features and bugfixes are welcome! :)

License

MIT License