stars-rating-react-hooks ⭐️
Customizable react component for rating stars
- Define
config
object - import { StarsRating } from "stars-rating-react-hooks"
- Start using
<StarsRating config={config} />
Install
npm install --save stars-rating-react-hooks
Usage (Basic)
import React from 'react'
import { StarsRating } from "stars-rating-react-hooks";
function Example() {
const config = {
number: 5,
value: 4.5,
renderFull: (
<img src="https://img.icons8.com/ios-filled/50/000000/star--v1.png" />
),
renderEmpty: (
<img src="https://img.icons8.com/ios/50/000000/star--v1.png" />
),
renderHalf: (
<img src="https://img.icons8.com/ios-filled/50/000000/star-half-empty.png" />
)
};
return <StarsRating config={config} />
}
export default Example
More info on prop getters
Demo
Basic demo
License
MIT © 07harish