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

react-native-stock-star-rating

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-stock-star-rating

☆ React Native stock star rating component with zero dependencies

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
108
decreased by-15.62%
Maintainers
1
Weekly downloads
 
Created
Source
NPM VERSIONNPM WEEKLY DOWNLOADSGITHUB STARYOUTUBE VIEWSNPM LIFETIME DOWNLOADS

☆ React Native Stock Star Rating

🟢 React Native Stock Star Rating component with no dependencies

Light Weight Easy to use star rating.
  • 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} />
  )

};


Star Rating Demo

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

If you want to provide star rating input to capture the rating given by users, you can use this as below:

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}  
    />
  )

};


Star Rating Input Demo

⭐ 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)

Keywords

FAQs

Package last updated on 15 Jan 2023

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