1.0.2 • Published 2 years ago

f20manuel-react-native-rating v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

React Native Rating by f20manuel

Installation

Install the package using yarn or npm:

yarn add f20manuel-react-native-ratings

// OR

npm install --save f20manuel-react-native-ratings

Usage

import Rating from 'f20manuel-react-native-ratings';

export default function App() {
  const [rating, setRating] = useState(0);

  return (
    <Rating
      rating={rating}
      onFinishRating={setRating}
    />
  );
}

API

propdefaulttypedescription
rating0numberTotal number of ratings to display
ratingCount5numberTotal amount of icons to display
onFinishRatingnonefunction(value: number)Callback method when the user finishesrating. Gives you the final rating value as a whole number
iconstarstringicon displayed when selected (icon name in fontawesome)
emptyIconstar-ostringicon displayed when not selected (icon name in fontawesome)
color#F9BB01CSS ColorHexadecimal code of the selected icon
emptyColor#F9BB01CSS ColorHexadecimal code of the not selected icon
size32numberIcon size in pixels