Skip to main content
Version: Next 🚧

Migrate from react-native-star-rating-widget

- import StarRating, { StarRatingDisplay } from 'react-native-star-rating-widget';
+ import { Rating } from '@elik56a/react-native-pickers';

- <StarRating rating={stars} onChange={setStars} />
+ <Rating step={0.5} value={stars} onChange={setStars} />

- <StarRatingDisplay rating={4.5} />
+ <Rating readOnly value={4.5} />
star-rating-widgetReact Native Pickers
rating / onChangevalue / onChange, once on a tap or the end of a drag
StarRatingDisplayreadOnly
maxStarsmax
starSizesize
color / emptyColorcolor / emptyColor
step="half" (default)step={0.5}; the default here is 1
step="quarter"step={0.25}
enableSwipingalways on: tap or drag
onRatingStart / onRatingEndonChange fires once, when the drag ends
StarIconComponentrenderIcon={({ index, filled, color, size }) => …}
starStyle / starContainerStylestyles={{ item }} / styles={{ container }}
accessibilityLabelaccessibilityLabel, and formatValue for the value
animationConfig—

Mind the default step: half stars here need step={0.5}. Rating has no SVG dependency, so there's nothing else to install.

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