This is a sample React project, built around a StarRating component which displays stars and half-stars based on the inputs you give it, similar to what you might see on Amazon or other ecommerce websites.
git clone https://github.com/Jantho1990/react-star-rating.git react-star-rating cd react-star-rating npm install npm start
This should open a page on your browser to the demo app. If not, you should be able to access it via
How To Use
Change the inputs via the inputs section:
Ratingchanges the actual rating.
Min Ratingsets the lower limit for a rating.
Max Ratingsets the upper limit for a rating.
Star Ratiosets how many rating points are required to add a star.
Updating the input values should show in the field of stars below the React logo. Visually, increments only occur in half-stars, but you can set the rating to anything you want.
I Want To Use This In A Real App
This is just a sample project. It was not designed for inclusion in a real app. That said, if it inspires you, that's awesome!