UNPKG

1.85 kBTypeScriptView Raw
1import React from "react";
2import { StyleProp, ViewStyle } from "react-native";
3export declare type TapRatingProps = {
4 /**
5 * Total number of ratings to display
6 *
7 * Default is 5
8 */
9 count?: number;
10 /**
11 * Labels to show when each value is tapped
12 *
13 * e.g. If the first star is tapped, then value in index 0 will be used as the label
14 *
15 * Default is ['Terrible', 'Bad', 'Okay', 'Good', 'Great']
16 */
17 reviews?: string[];
18 /**
19 * Determines if to show the reviews above the rating
20 *
21 * Default is true
22 */
23 showRating?: boolean;
24 /**
25 * Color value for review.
26 *
27 * Default is #f1c40f
28 */
29 reviewColor?: string;
30 /**
31 * Size value for review.
32 *
33 * Default is 40
34 */
35 reviewSize?: number;
36 /**
37 * Initial value for the rating
38 *
39 * Default is 3
40 */
41 defaultRating?: number;
42 /**
43 * Style for star container
44 *
45 * Default is none
46 */
47 starContainerStyle?: StyleProp<ViewStyle>;
48 /**
49 * Style for rating container
50 *
51 * Default is none
52 */
53 ratingContainerStyle?: StyleProp<ViewStyle>;
54 /**
55 * Callback method when the user finishes rating. Gives you the final rating value as a whole number
56 */
57 onFinishRating?: (number: any) => void;
58 /**
59 * Whether the rating can be modiefied by the user
60 *
61 * Default is false
62 */
63 isDisabled?: boolean;
64 /**
65 * Color value for filled stars.
66 *
67 * Default is #004666
68 */
69 selectedColor?: string;
70 /**
71 * Size of rating image
72 *
73 * Default is 40
74 */
75 size?: number;
76 /**
77 * Pass in a custom base image source
78 */
79 starImage?: string;
80};
81declare const TapRating: React.FunctionComponent<TapRatingProps>;
82export default TapRating;