AirbnbRating
Ratings are used to collect measurable feedback from users. Use Rating over an Input where imagery can increase user interaction. This component is imported from @rn-vui/ratings. There are two types of rating - TapRating and SwipeRating. This documentation is for Tap Rating version.
Usage
Props
Name | Type | Default | Description |
---|---|---|---|
count | number | 5 | Total number of ratings to display. |
defaultRating | number | 3 | Initial value for the rating |
isDisabled | boolean | false | Whether the rating can be modified by the user |
onFinishRating | (value: number) => void | Callback method when the user finishes rating. Gives you the final rating value as a whole number | |
ratingContainerStyle | View Style | undefined | Style for rating container |
reviewColor | string | #f1c40f | Color value for review. |
reviewSize | number | 40 | Size value for review. |
reviews | string[] | ['Terrible', 'Bad', 'Okay', 'Good', 'Great'] | Labels to show when each value is tapped.e.g. If the first star is tapped, then value in index 0 will be used as the label. |
selectedColor | string | #004666 | Color value for filled stars. |
showRating | boolean | true | Determines if to show the reviews above the rating. |
size | number | 40 | Size of rating image |
starContainerStyle | View Style | undefined | Style for star container |
starImage | string | Pass in a custom base image source | |
starStyle | ImageStyle | Style for star | |
unSelectedColor | string | #BDC3C7 | Color value for not filled stars. |