React Awesome Stars Rating is a simple star component with easy integration for your React applications.
npm install react-awesome-stars-ratingReact Awesome Stars Rating is a simple star component with easy integration for your React applications.
- Previews
- Features
- Installation
- Usage
- Examples
- Documentation
!react-awesome-stars-rating preview
- Half stars
- Custom size and color
- Value shows with high precision
- Easy integration with Redux
- Accessibility
- SVG Icons
npm install react-awesome-stars-rating
``javascript
import React from 'react';
import ReactDOM from 'react-dom';
import ReactStarsRating from 'react-awesome-stars-rating';
const onChange = (value) => {
console.log(React Stars Rating value is ${value});
};
const ReactStarsExample = ({ value }) => {
return
};
ReactDOM.render(
`
| Name | Description | Type | Default |
| :------------- | :------------------------------------------------------- | :------- | :-------------- |
| id | Identifier | String | ${Date.now()} |true
| value | Value | Number | 0 |
| onChange | A function, that will be invoked when value have changed | Function | null |
| isEdit | If the rating is in editing mode | Boolean | true |true` half stars are available | Boolean | true |
| isHalf | If
| count | Count of the stars | Number | 5 |
| size | Size of the stars | Number | 25 |
| starGap | Gap between the stars | Number | 0 |
| className | Class name for button container | String | '' |
| primaryColor | Star's color when star is active | String | 'orange' |
| secondaryColor | Star's color when star isn't active | String | 'grey' |
| isArrowSubmit | Left arrow or right arrow click onvokes onChange | Boolean | false |
You can see live examples by below links:
- Simple Example
- Integration with redux-form