react-native-easy-rating

0.2.1 • Public • Published

react-native-easy-rating

npm package npm Gitter

A React Native component for rating view. Compatible with both iOS and Android.

Tested with react-native 0.64.1

Installation

yarn add react-native-easy-rating

Usage

Props

Prop Type Description Required Default
rating number Set initial rating No 0
max number Set maximum of rating No 5
iconWidth number Set width of icon No 36
iconHeight number Set height of icon No 36
iconSelected image Set image of selected icon No
iconUnselected image Set image of unselected icon No
onRate function(rating) Trigger when rating changes No
editable boolean Ability to change rating by tap No Yes

Example

import  Rating from 'react-native-easy-rating';
...
export default function App() {
  const [rating,setRating] = useState();

  return (
    <Rating
      rating={rating}
      max={5}
      iconWidth={24}
      iconHeight={24}
      onRate={setRating}/>
  );
}

Package Sidebar

Install

npm i react-native-easy-rating

Weekly Downloads

41

Version

0.2.1

License

ISC

Unpacked Size

44.4 kB

Total Files

14

Last publish

Collaborators

  • clh161