npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rating-react

v1.0.4

Published

A component that allows the user to select a rating with stars, numbers, or emojis, useful for reviews.

Downloads

8

Readme

npm version

Rating React

Rating React is an easy-to-use react rating component that allows the user to select a rating with stars, numbers or emojis, useful for reviews.

Demo

See react-rating in action.

Installation

You can install rating-react component using the npm package manager:

npm i rating-react

Dependencies

The react-rating component peer depends on the React library, the Prop-Types library and React-Icons library.

Install React using npm too:

npm i react

Install Prop-Types using npm too:

npm i prop-types

Install React-Icons using npm too:

npm i react-icons

Usage

  1. Install the library

    npm i rating-react
  2. Import the library into your component

    import Rating from "rating-react";
  3. Call it inside your component

    <Rating />

Properties

| Prop | Type | Description | Default | | ------------------- | ------------------ | ----------------------------------------------------------------------- | --------- | | maxRating | number | Maximum number of icons for rating. | 5 | | onRate | function | Callback function that is called when the user selects a rating. | undefined | | value | number | Rating value (if externally controlled). | undefined | | readOnly | bool | If set to true, do not allow user interaction. | false | | disabled | bool | If set to true, disables the component. | false | | size | string | Icon size. Options: "sm", "md", "lg". | "md" | | defaultColor | string | Color of inactive icons. | "#ffc107" | | activeColor | string | Color de los íconos activos. | undefined | | showNoRatingGiven | bool | Displays text if no rating has been given. | false | | disabledOpacity | number | Opacity of the component when disabled. | 0.5 | | resettable | bool | Allows resetting the rating to 0. | false | | tooltip | array of strings | Tooltips to display when hovering over the icons. | [] | | iconType | string | Type of icon to display. Options: "stars", "hearts", "thumbs", "faces". | "stars" | | ariaLabel | string | ARIA label for accessibility. | "rating" | | showValue | bool | Displays the current rating value. | false |

License

MIT License