0.2.0 • Published 2 years ago

react-native-custom-rating v0.2.0

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

react-native-custom-rating

Custom rating package for react native applications

Installation

npm install react-native-custom-rating

examples/src

npm.io

Usage

import { Rating } from 'react-native-custom-rating';

// ...

<Rating
  emptyStarIcon={{
    uri: emptyIcon,
  }}
  filledStarIcon={{
    uri: filledIcon,
  }}
  halfStarIcon={{
    uri: halfIcon,
  }}
  rating={4.5}
  size={20}
  readonly={false}
  onFinishRating={(rating) => {
    //...
  }}
  elementStyling={{
    marginHorizontal: 20,
  }}
/>;

Props

PropTypeRequiredDescription
sizenumberfalsesize of Rating Image in width and height, default is 10
maxRatingnumberfalseMax value of rating, default is 5
ratingnumbertrueRating numeric value
readonlybooleanfalseif false user will be able to input ratings
readonlybooleanfalseif false user will be able to input ratings
onFinishRatingfunctionfalsefunction invoked when user select rating element
renderHalfStarIconfunctionfunction/iconrender custom half rating element
renderEmptyStarIconfunctionfunction/iconrender custom empty rating element
renderFilledStarIconfunctionfunction/iconrender custom empty rating element
halfStarIconimage/urifunction/iconpass image or uri for half star icon
emptyStarIconimage/urifunction/iconpass image or uri for empty star icon
filledStarIconimage/urifunction/iconpass image or uri for filled star icon
containerStyleobjectfalsestyle for container
elementStylingobjectfalsestyle for rating element

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library