0.1.7 • Published 7 years ago

react-native-stars-rating v0.1.7

Weekly downloads
23
License
ISC
Repository
github
Last release
7 years ago

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

PropDescriptionDefaultRequired
sizeThe Size of the stars20no
colorDetermine the color of the stars rating#EEB211no
rateShows current rating for the star component to display0 (if not active) or 1 (if active)yes
rateMaxDetermine the maximum stars rating to display5yes
isActiveEnable the stars rating to be clickablefalseyes
onStarPressA function that returns the current active rating number using callbacknullno
isHalfStarEnabledEnable the star rating component to support half ratingfalseno
roundingEnabled rounding logic on rating (3.25 -> 3.5) if using up or vice versadownyes

IOS Showcase

rn-stars-ios

Android Showcase

rn-stars-android

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago