react-rating-app

0.1.9 • Public • Published

React Rating App

A simple react component for adding a star rating to your project, with package size of just 4.9 kb

Install

npm

npm i react-rating-app

Usage

import React from "react";
import { Rating } from "react-rating-app";

export function MyComponent() {
  return (
    <div>
      <Rating size={24} maxRating={10} onSetRating={setStarRating} />
      //can use other props also refer later section
    </div>
  );
}

Available Props

    maxRating: PropTypes.number,   //will give number of stars we want default is 5
    defaultRating: PropTypes.number,   // its 0 stars by default (rating given by user)
    color: PropTypes.string,   // color of the stars defaut is yellow
    size: PropTypes.number,    //how big stars we want default is 48
    messages: PropTypes.array, // We can also pass message like awesome, good etc
    className: PropTypes.string, /// provide styling to stars
    onSetRating: PropTypes.func, // set Rating by state

### License

MIT © [rbzashu](https://github.com/ashurbz)

Readme

Keywords

Package Sidebar

Install

npm i react-rating-app

Weekly Downloads

112

Version

0.1.9

License

MIT

Unpacked Size

12.2 kB

Total Files

8

Last publish

Collaborators

  • rbzashu