# react-native-stars-rating

> react-native stars rating component

Latest version **0.1.7** (published 2017-09-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-native-stars-rating
pnpm add react-native-stars-rating
yarn add react-native-stars-rating
bun add react-native-stars-rating
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2017-09-06 |
| First published | 2017-01-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | jiandy.ricky@gmail.com |
| Maintainers | rjiandy |
| Keywords | react-native, rating-stars, stars, rating |

## Links

- npm: https://www.npmjs.com/package/react-native-stars-rating
- Repository: https://github.com/rjiandy/react-native-stars-rating
- Homepage: https://github.com/rjiandy/react-native-stars-rating#readme
- Issues: https://github.com/rjiandy/react-native-stars-rating/issues
- npm.io page: https://npm.io/package/react-native-stars-rating

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.1.7 (latest) — 2017-09-06
- 0.1.6 — 2017-02-21
- 0.1.5 — 2017-01-31
- 0.1.4 — 2017-01-31
- 0.1.3 — 2017-01-31
- 0.1.2 — 2017-01-31
- 0.1.1 — 2017-01-31
- 0.1.0 — 2017-01-31
- 0.0.5 — 2017-01-31
- 0.0.4 — 2017-01-31
- 0.0.3 — 2017-01-31
- 0.0.2 — 2017-01-31
- 0.0.1 — 2017-01-31

## README

# react-native-stars-rating
This is a simple rating component for react-native.

## Dependencies
1. react-native-vector-icons
2. class-autobind

## Installation
`$ npm install react-native-stars-rating --save`

## Link Material Icons Usage
`$ react-native link`

## Usage Example
```
import Stars from 'react-native-stars-rating';

<Stars
  isActive={true}
  rateMax={5}
  isHalfStarEnabled={false}
  onStarPress={(rating) => console.log(rating)}
  rate={3}
  size={60}
/>
```
## Props
```
type Props = {
  size?: number;
  color?: number;
  rate: number;
  rateMax: number;
  isActive: boolean;
  onStarPress?: (rating: number) => void;
  isHalfStarEnabled?: boolean;
  rounding: 'up' : 'down';
};
```
## Props Explanation
Prop    | Description | Default | Required
---     | ----------- | ------- | --------
size   | The Size of the stars | 20 | _no_
color  | Determine the color of the stars rating | #EEB211 | _no_
rate    | Shows current rating for the star component to display | 0 _(if not active)_ or 1 _(if active)_ | __yes__
rateMax | Determine the maximum stars rating to display | 5 | __yes__
isActive| Enable the stars rating to be __clickable__ | `false` | __yes__
onStarPress | A function that returns the current active rating number using callback | `null` | _no_
isHalfStarEnabled | Enable the star rating component to support half rating | `false` | _no_
rounding| Enabled rounding logic on rating (3.25 -> 3.5) if using up or vice versa | `down` | __yes__

## IOS Showcase
![rn-stars-ios](https://cloud.githubusercontent.com/assets/20079730/22450974/10a889a0-e79d-11e6-96f8-2632a9e8cb40.gif)

## Android Showcase
![rn-stars-android](https://cloud.githubusercontent.com/assets/20079730/22450985/22a8f0ea-e79d-11e6-9007-7fab8390eb14.gif)

---
_Source: https://npm.io/package/react-native-stars-rating · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
