/react-native-star-rating

A React Native component for generating and displaying interactive star ratings

Primary LanguageJavaScript

React Native Star Rating Component

A React Native component for generating and displaying interactive star ratings. Compatible with both iOS and Android.

Table of Contents

  1. Usage
  2. Requirements
  3. Development
    1. Installation
    2. Roadmap
  4. Contributing

Usage

Install the package via npm install react-native-star-rating --save. Then require it in your JavaScript file via require('react-native-star-rating'). Check out an example usage below:

var StarRating = require('react-native-star-rating');

var ExampleComponent = React.createClass({
  onStarRatingPress: function (value) {
    console.log('Rated ' + value + ' stars!');
  },
  render() {
    return (
      <StarRating 
        maxStars={5}
        rating={3.5}
        disabled={false}
        starSize={15}
        selectedStar={this.onStarRatingPress}
      />
    );
  }
});

module.exports = ExampleComponent;

Requirements

  • Node

Development

Installation

npm install react-native-star-rating --save

Roadmap

View the project roadmap here

Contributing

See CONTRIBUTING.md for contribution guidelines.