react-rating-emoji
v2.0.4
Published
animated emoji rating component
Downloads
746
Maintainers
Readme
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