Overview Official Website

React-Rating js is the best star rater for the browser. No dependencies. Unlimited number of stars.

Add Package
yarn add react-simple-star-rating
Import Package
import Rating from "react-simple-star-rating";
Remove Package
yarn remove react-simple-star-rating (or you can remove package by removing specific package from package.json )
Examples:
Title React
Basic Rater
<Rating
initialValue={3}
size={25}
allowFraction
/> 
Rater with Step
<Rating
initialValue={1.5}
size={25}
/>
Custom Messages
<Rating
size={25}
/> 
Example with unlimited number of stars. readOnly option is set to true
<Rating
size={20}
initialValue={5}
iconsCount={16}
/>
On Hover Event
const [customize, setcustomize] = useState<number>(0)

<Rating
size={25}
initialValue={1}
onPointerEnter={() => setcustomize(customize)}
/>
Clear/Reset Rater
const [rating, setRating] = useState(0)
const handleRating = (rate: number) => {
    setRating(rate)
}                                        
const handleReset = () => {
    setRating(0)
}

<Rating
onClick={handleRating} 
initialValue={rating} 
size={25}
/>
<Button id="raterreset-button" variant='light' size="sm" className="ms-2" onClick={handleReset}>Reset</Button>
© Skote.