Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-animated-rating

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-animated-rating

An animated rating React component

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-74.29%
Maintainers
1
Weekly downloads
 
Created
Source

react-animated-rating

NPM version Build npm-typescript License

react-animated-rating is an animated rating React component.

Demo

See react-animated-rating in action.

Installation

yarn add react-animated-rating

OR

npm install react-animated-rating

Usage

Add Rating to your component:

import Rating from 'react-animated-rating';

<Rating />

Properties

PropertyTypeDefaultDescription
animationbooleantrueWhether icon animation is enabled or not.
countnumber5Number of icons.
disabledbooleanfalseWhether icon is disabled or not.
fillednumber0Number of filled icons.
iconReactNode-Embed SVG element as a React node.
initialBouncebooleantrue - when disabled is false; false - when disabled is trueWhether bounce animation onload is enabled or not. The default value is determined by the disabled prop.
sizestring"1.5em"Font size of the SVG icon (Default width = 1em and height = 1em. Therefore, if size = 1.5em, then width = 24px and height = 24px). Does not work if the property icon is set. Only works with the default star icon.
wrapperClassNamestring-Wrapper class for the Rating component.

Callbacks

CallbackTypeDescription
onChangefunction (value) {}Returns the rating value when the icon is clicked.

Change Icon Color

The CSS root variable --icon-color depicts the color of the SVG icon.

To change its color, specify the wrapperClassName and override the --icon-color variable as shown below.

JSX

import Rating from 'react-animated-rating';

<Rating wrapperClassName="icon-red" />

CSS

.icon-red { --icon-color: red; }

Keywords

FAQs

Package last updated on 13 Oct 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc