Skip to main content
Version: v1.0.0

Migrate from react-native-ratings

react-native-ratings hasn't had a release since May 2021, and draws its stars from bundled images. Rating draws them as text, takes any icon you already use through renderIcon, is adjustable for screen readers and steps with arrow keys on the web.

Code changes​

- import { AirbnbRating, Rating } from 'react-native-ratings';
+ import { Rating } from '@elik56a/react-native-pickers';

- <AirbnbRating
- count={5}
- defaultRating={3}
- size={24}
- selectedColor="#f1c40f"
- showRating={false}
- onFinishRating={setStars}
- />
+ <Rating defaultValue={3} size={24} color="#f1c40f" onChange={setStars} />

Props​

react-native-ratingsReact Native Pickers
count / ratingCountmax (default 5)
defaultRating / startingValuedefaultValue, or value to control it
onFinishRatingonChange, once on a tap or the end of a drag
onStartRating / onSwipeRating—
size / imageSizesize (default 32)
selectedColor / ratingColorcolor
unSelectedColor / ratingBackgroundColoremptyColor
jumpValue={0.5} / fractionsstep={0.5}
minValuetaps pick at least one step; keys can go to 0
isDisabled / readonlyreadOnly to show a score, or disabled to dim it
type="heart" / starImage / ratingImagerenderIcon={({ color, size }) => …}
reviews + showRatingrender your own label from value
starContainerStyle / stylestyles={{ container, item }} / style

See all migration guides for other libraries, and Comparison for when another library is the better choice.