Skip to main content

Rating

The Rating component of our library is a user interface element used to display the rating that users have assigned to a product, service, or content. It usually appears as a series of stars or other symbols that you can customize, usually ranging from one star (lowest) to five stars (highest). Ratings provide valuable information about user satisfaction and preferences, helping developers and companies improve their products or services.

Information

This is a read-only component for the purpose of displaying the rating.

Usage

Basic usage

import {Rating} from 'rn-inkpad';

const MyComponent = () => {
return <Rating />;
};

Props

NameTypeDefaultDescription
colorstring'#FFD700'Rating icon color.
icon'heart' | 'star'starRating icon.
ratingnumber3Rating.
sizenumber35Rating icon size.
styleStyleProp<ViewStyle>Custom styles for your rating component.
totalnumber5Rating max value.

Usage with props

import {Rating} from 'rn-inkpad';

const MyComponent = () => {
return <Rating color="#FF0000" icon="heart" rating={4.5} />;
};

Example with props