🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

rating-react

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rating-react

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

1.0.4
latest
Source
npm
Version published
Maintainers
0
Created
Source

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

  • Install the library

    npm i rating-react
    
  • Import the library into your component

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

    <Rating />
    

Properties

PropTypeDescriptionDefault
maxRatingnumberMaximum number of icons for rating.5
onRatefunctionCallback function that is called when the user selects a rating.undefined
valuenumberRating value (if externally controlled).undefined
readOnlyboolIf set to true, do not allow user interaction.false
disabledboolIf set to true, disables the component.false
sizestringIcon size. Options: "sm", "md", "lg"."md"
defaultColorstringColor of inactive icons."#ffc107"
activeColorstringColor de los íconos activos.undefined
showNoRatingGivenboolDisplays text if no rating has been given.false
disabledOpacitynumberOpacity of the component when disabled.0.5
resettableboolAllows resetting the rating to 0.false
tooltiparray of stringsTooltips to display when hovering over the icons.[]
iconTypestringType of icon to display. Options: "stars", "hearts", "thumbs", "faces"."stars"
ariaLabelstringARIA label for accessibility."rating"
showValueboolDisplays the current rating value.false

License

MIT License

FAQs

Package last updated on 13 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts