react-native-elements#Rating JavaScript Examples
The following examples show how to use
react-native-elements#Rating.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Card.js From iitj-canteen with GNU General Public License v3.0 | 6 votes |
render() {
return (
<View style={styles.container}>
<Image style={styles.img} source={{ uri: this.props.data.imageURI }} />
<View style={styles.bottomContainer}>
<Text style={styles.title}>{this.props.data.title}</Text>
<Rating imageSize={15} readonly={true} startingValue={this.props.data.ratings} />
</View>
</View>
);
}
Example #2
Source File: rating.playground.jsx From playground with MIT License | 4 votes |
RatingPlayground = () => {
const params = useView({
componentName: "Rating",
props: {
fractions: {
type: PropTypes.Number,
value: 0,
},
imageSize: {
type: PropTypes.Number,
value: 70,
},
minValue: {
type: PropTypes.Number,
value: 0,
},
onFinishRating: {
type: PropTypes.Function,
value: `() => console.log("onFinishRating()")`,
},
onStartRating: {
type: PropTypes.Function,
value: `() => console.log("onStartRating()")`,
},
ratingBackgroundColor: {
type: PropTypes.String,
value: "#FFF",
},
tintColor: {
type: PropTypes.String,
value: "",
},
ratingColor: {
type: PropTypes.String,
value: "#FF0",
},
ratingCount: {
type: PropTypes.Number,
value: 5,
},
ratingImage: {
type: PropTypes.String,
value: "star",
},
ratingTextColor: {
type: PropTypes.String,
value: "#222",
},
readonly: {
type: PropTypes.Boolean,
value: false,
},
reviews: {
type: PropTypes.Array,
value: `["Terrible", "Bad", "Okay", "Good", "Great"]`,
},
showRating: {
type: PropTypes.Boolean,
value: true,
},
startingValue: {
type: PropTypes.Number,
value: "0",
},
style: {
type: PropTypes.Object,
value: `{}`,
},
type: {
type: PropTypes.Enum,
options: {
star: "star",
rocket: "rocket",
bell: "bell",
heart: "heart",
custom: "custom",
},
value: "star",
},
},
scope: {
Rating,
},
imports: {
"react-native-elements": {
named: ["Rating"],
},
},
});
return (
<React.Fragment>
<Playground params={params} />
</React.Fragment>
);
}