Description
react-rater is an interactive, customizable star rating component for React. By default it shows five stars. The total, rating, interactive and callback props let you change how many stars show, the starting rating and whether people can click. Setting interactive to false creates a read-only rater, and in that mode the rating can have a fractional part, such as 3.6, which partly fills the fourth star. The component has three callbacks. onRate fires when a user clicks, onRating fires while the mouse moves between stars, and onCancelRate fires when the mouse leaves the rater. The README says most apps only need onRate. The callbacks receive the rating together with React's SyntheticEvent. Styling can be done with CSS, or in JavaScript by defining your own star component, which receives a fillRatio value from 0 to 1 that describes how much of the star is filled. The README includes a live demo and install instructions. For React versions below 16.8, which lack hooks, the README says to keep using react-rater version 5. The project is released under the BSD license and is aimed at React developers who need a star rating input or display.…
Highlights
- Star rating for React
- Interactive or read-only mode
- Fractional ratings in read-only mode
- onRate, onRating and onCancelRate callbacks
- Custom star component using fillRatio
Ratings & Reviews
No ratings yet
Be the first to rate react-rater.
People also visit

react-native-in-app-review
react native in app review, to rate on Play store, App Store, Generally
react-rater FAQ
What is react-rater?
An interactive, customizable star rating component for React.
How do I make a read-only rater?
Set interactive to false. The rating can then contain a fractional part, such as 3.6.
Which callback should I use?
onRate for clicks. The README says most apps only need it. onRating and onCancelRate handle hover behavior.
Does it work with older React?
For React versions below 16.8, which lack hooks, the README says to use react-rater version 5.
How do I style the stars?
Use CSS, or define your own star component that uses the fillRatio value from 0 to 1.
What are the best react-rater alternatives?
Popular alternatives to react-rater include rc-rate, react-rating and react-slider. See all react-rater alternatives

















