react-native-rating
Display ratings in your react-native app like a pro. Works on both iOS and Android.
Install
npm i -S react-native-rating
or
yarn add react-native-rating
Usage
const images = starFilled: starUnfilled: const myRandoComponent = <Rating onChange= console selectedStar=imagesstarFilled unselectedStar=imagesstarUnfilled config= easing: Easing duration: 350 stagger=80 maxScale=14 starStyle= width: 40 height: 40 />
Customization
Refer to the propTypes
and defaultProps
definition below:
static propTypes = max: PropTypesnumber initial: PropTypesnumber onChange: PropTypesfunc config: PropTypesshape easing: PropTypesfuncisRequired duration: PropTypesnumberisRequired editable: PropTypesbool stagger: PropTypesnumber maxScale: PropTypesnumber starStyle: ViewPropTypesstyle containerStyle: ViewPropTypesstyle selectedStar: PropTypesnumberisRequired unselectedStar: PropTypesnumberisRequired onAnimationComplete: PropTypesfunc static defaultProps = max: 5 initial: 0 {} config: easing: Easing duration: 400 stagger: 100 maxScale: 11 starStyle: width: 36 height: 36 editable: true containerStyle: flexDirection: 'row' {}
License
MIT