1.0.6 ā€¢ Published 1 year ago

react-native-stock-star-rating v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago
NPM VERSIONNPM WEEKLY DOWNLOADSGITHUB STARYOUTUBE VIEWSNPM LIFETIME DOWNLOADS

šŸŸ¢ React Native Stock Star Rating component with no dependencies

  • Equivalent to React Native Stock Component
  • Use the color of your choice
  • Use bordered or filled star upon your choice
  • Works on all the platforms Android, Ios and Web in the same way
  • Zero dependencies

Compatibility

iOSAndroidWebExpo
āœ…āœ…āœ…āœ…

šŸ”Œ Installation

$ npm install react-native-stock-star-rating

OR

$ yarn add react-native-stock-star-rating

šŸ˜Ž Displaying the rating

import { Rating } from 'react-native-stock-star-rating'

const App = () => {

  return(
    <Rating stars={4.7} maxStars={5} size={25} />
  )

};

For Live Demo (Expo Snack)

ā­ Props for rating

NameTypeDescriptionDefault
maxStarsNumberNumber of stars to show (Optional)5
starsNumberFilled stars to show or value of rating0
sizeNumberSize of the star (Optional)25
colorStringUse the color you want to give to the rating stars (Optional)#FFDF00
borderedbooleanSet to true if you want bordered stars (Optional)false

šŸ˜Ž Star Rating Input

import { RatingInput } from 'react-native-stock-star-rating'

const App = () => {

  const [rating,setRating] = React.useState(0);
  

  return(
    <RatingInput 
        rating={rating} 
        setRating={setRating} 
        size={50}  
        maxStars={5} 
        bordered={false}  
    />
  )

};

ā­ Props for rating input

NameTypeDescriptionDefault
ratingNumberState variable to store the rating (Required)0
setRatingFunctionFunction to update the rating state variable (Required)-
maxStarsNumberNumber of stars to show (Optional)5
starsNumberFilled stars to show or value of rating0
sizeNumberSize of the star (Optional)25
colorStringUse the color you want to give to the rating stars (Optional)#FFDF00
borderedbooleanSet to true if you want bordered stars (Optional)false
onRatingFunctionCallback function to execute after rating input is given (Optional)-

ā–¶ļø Watch Tutorial Video

Watch video

For Live Demo (Expo Snack)