react-rating-emoji
An animated emoji rating component
Install
npm install --save react-rating-emoji
Usage
import React, { useState } from 'react'
import { RatingComponent } from 'react-rating-emoji'
import 'react-rating-emoji/dist/index.css'
const App = () => {
const [rating, setRating] = useState(0);
const handleRating = (newRating) => {
setRating(newRating);
}
return <RatingComponent rating={rating} onClick={handleRating} />
}
export default App
Props
prop | Type | Default | Required | Description |
---|
rating | number | 0 | no | current rating |
onClick | event | | no | event handler (rating) |
className | string | | no | container class name |
id | string | emoji-container | no | container id name |
License
MIT © https://github.com/ultimateakash