https://github.com/ritik48/star-rating
Easy to integrate StarRating Component in React
https://github.com/ritik48/star-rating
reactjs star-rating-component
Last synced: about 2 months ago
JSON representation
Easy to integrate StarRating Component in React
- Host: GitHub
- URL: https://github.com/ritik48/star-rating
- Owner: ritik48
- Created: 2023-12-26T16:13:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-26T22:00:11.000Z (over 1 year ago)
- Last Synced: 2025-03-21T10:40:56.717Z (2 months ago)
- Topics: reactjs, star-rating-component
- Homepage: https://www.npmjs.com/package/star-ratings-react
- Size: 543 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Start Rating Component
Save time and effortlessly implement a star rating system in your app without the need to write the entire code from scratch.
It's easily customizable and straightforward to integrate.
### How to use:
- Run the following command
```
npm install star-ratings-react
```- Import the StarRating component into your React application.
```
import { StarRating } from "star-ratings-react";
```- Define a state variable to store the rating value in your component.
```
const [rating, setRating] = useState(0);
const [rating2, setRating2] = useState(0);
const [rating3, setRating3] = useState(0);
const [rating4, setRating4] = useState(0);
```- Add the StarRating component to your JSX, passing the state variable and the function to set the rating.
```
return (
<>
Hello, Stars !!!
>
);
```