rating-react-native

1.1.0 • Public • Published

Rating React Native (rating-react-native)

This is a package for implementing simple star rating on components easily with functionality.

alt text

Installation

Use the package manager npm to install rating-react-native.

npm install rating-react-native --save
react-native link

Usage

import React, { Component } from 'react'
import StarRating from 'rating-react-native'
 
export default class App extends Component {
  
  state = {
    stars: 0,
  }
 
  handleStars = (stars) => {
    this.setState({ stars })    //get the rating
  }
 
  render() {
    return (
      <StarRating onPress={this.handleStars} />
    )
  }
}

Props

Property Default Description
starCount 5 rendering number of stars
fillColor yellow color of filled stars or selected stars
color black color of unfilled stars or unselected stars
size 50 size of star

License

[MIT]

Package Sidebar

Install

npm i rating-react-native

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

3.43 kB

Total Files

3

Last publish

Collaborators

  • t009s