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

@licuido/ui_rating

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@licuido/ui_rating

The Rating component is a customizable rating widget that allows users to provide feedback or rate items using stars or emojis. It provides various options for customizing the icons, styles, and behavior of the rating component. The Rating component can b

0.0.2
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Rating

The Rating component is a customizable rating widget that allows users to provide feedback or rate items using stars or emojis. It provides various options for customizing the icons, styles, and behavior of the rating component. The Rating component can be used in both star and emoji modes based on the variant prop.

Author

  • @author Akila K akila@crayond.co

Story Book Link Login

PlayGround

Try it have a fun codeBox

Installation

npm i @licuido/ui_rating

Import component

import { Rating } from '@licuido/ui_rating';

Usage

<Rating  variant= 'star'
    precision = {1}
    starRatingData= {[
      {
        filled: <FavoriteIcon />,
        unFilled: <FavoriteBorder />,
        starValue: 4.5,
        overallRating: '240 Reviews',
      },
      {
        filled: <FavoriteIcon />,
        unFilled: <FavoriteBorder />,
        starValue: 3.5,
        overallRating: '240 Reviews',
      },
    ]}
  overallRatingStyle= {}
  onClick={(rating) => handleRatingChange(rating.starValue)} />

Image

Variant1

Emoji rating

Variant2

Star rating

Sample Code

<Rating
 variant= 'star'
    precision = {1}
    starRatingData= {[
      {
        filled: <FavoriteIcon />,
        unFilled: <FavoriteBorder />,
        starValue: 4.5,
        overallRating: '240 Reviews',
      },
      {
        filled: <FavoriteIcon />,
        unFilled: <FavoriteBorder />,
        starValue: 3.5,
        overallRating: '240 Reviews',
      },
    ]}
  overallRatingStyle= {}
  onClick={(rating) => handleRatingChange(rating.starValue)}
/>

Props

NameDescriptionDefaultControl
ratingIdstringstringstring
variant"star" or "emoji""emoji"star / emoji
emojiDataAn array of objects with properties SelectIcon, unSelectIcon, label, and value[]Set object
selectedLabelStyleAn object with styles to apply to the selected label{}Set object
emojiContainerStyleAn object with styles to apply to the emoji container{}Set object
classNameA string representing the class name to apply to the component-Set string
sxAn object with styles to apply to the component root-Set object
starRatingDataAn array of objects with properties filled, unFilled, starValue, overallRating, and maximumIcon[]Set object
overallRatingAn object with styles to apply to the overallRating{}Set object
onMouseEnterA function called when the mouse enters a star() => {}-
onMouseLeaveA function called when the mouse leaves a star() => {}-
onClickA function called when a star is clicked() => {}-
isReadOnlyA boolean value indicating whether the component is read-onlyfalseSet boolean
isLabelVisibleA boolean value indicating whether the labels are visibletrueSet boolean
childrenStyleAn object with styles to apply to the children components{}Set object
precisionA number representing the precision of the rating1Set number

FAQs

Package last updated on 01 May 2025

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