An open API service indexing awesome lists of open source software.

https://github.com/mmusaib/react-native-stock-star-rating

☆ React Native stock star rating component with zero dependencies
https://github.com/mmusaib/react-native-stock-star-rating

react react-native react-native-star-rating react-native-stock-star-rating star starrating

Last synced: about 1 month ago
JSON representation

☆ React Native stock star rating component with zero dependencies

Awesome Lists containing this project

README

        

| | | | | |
| --------------------------------------- | -------- | ---------- |---------- |---------- |
| ![NPM VERSION](https://img.shields.io/npm/v/react-native-stock-star-rating?style=for-the-badge) | ![NPM WEEKLY DOWNLOADS](https://img.shields.io/npm/dw/react-native-stock-star-rating?color=%232CA215&label=WEEKLY%20DOWNLOADS&style=for-the-badge) | ![GITHUB STAR](https://img.shields.io/github/stars/mmusaib/react-native-stock-star-rating?label=Give%20Us%20A%20Star&style=for-the-badge) | ![YOUTUBE VIEWS](https://img.shields.io/youtube/channel/views/UCSwIR2KBHiqiProH3Me8IZQ?label=YOUTUBE%20VIEWS&style=for-the-badge) | ![NPM LIFETIME DOWNLOADS](https://img.shields.io/npm/dt/react-native-stock-star-rating?color=%232CA215&style=for-the-badge)


☆ 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

| iOS | Android | Web | Expo |
--------|---------|-----|------|
| ✅ | ✅ | ✅ | ✅ |

# 🔌 Installation

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

```

OR

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

# 😎 Displaying the rating
```jsx
import { Rating } from 'react-native-stock-star-rating'

const App = () => {

return(

)

};
```







Star Rating Demo

For Live `Demo` [(Expo Snack)](https://snack.expo.dev/@mmusaib/react-native-stock-star-rating)

# ⭐ Props for rating
| Name | Type | Description | Default |
| ---- | ---- | ----------- | ----------- |
| maxStars | Number | Number of stars to show (Optional) | 5
| stars | Number | Filled stars to show or value of rating | 0
| size | Number | Size of the star (Optional) | 25
| color | String | Use the color you want to give to the rating stars (Optional) | #FFDF00
| bordered | boolean | Set 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:

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

const App = () => {

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

return(

)

};
```







Star Rating Input Demo

# ⭐ Props for rating input
| Name | Type | Description | Default |
| ---- | ---- | ----------- | ----------- |
| rating | Number | State variable to store the rating (Required) | 0
| setRating | Function | Function to update the rating state variable (Required) | -
| maxStars | Number | Number of stars to show (Optional) | 5
| stars | Number | Filled stars to show or value of rating | 0
| size | Number | Size of the star (Optional) | 25
| color | String | Use the color you want to give to the rating stars (Optional) | #FFDF00
| bordered | boolean | Set to true if you want bordered stars (Optional) | false
| onRating | Function | Callback function to execute after rating input is given (Optional) | -

# ▶️ Watch Tutorial Video

[![Watch video](https://i.imgur.com/IAxLuSA.png)](https://youtu.be/eNCsP_YhGBk&t=15s)

For Live `Demo` [(Expo Snack)](https://snack.expo.dev/@mmusaib/react-native-stock-star-rating)