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

react-simple-star-ratings

v0.1.4

Published

An npm package for Different types of rating for your project

Downloads

5

Readme

React Simple Rating Package

A simple npm package for Different Types of Rating to your project.

NPM JavaScript Style Guide GitHub

Install

  • npm
npm i react-simple-star-ratings
  • Import the package in your app:
import {StarRating} from 'react-simple-star-ratings';
  • Get the Component from the package
<StarRating /*Availabe Props*//>
<TagStarRating /*Availabe Props*/ />

Usage

import React from 'react'
import {StarRating} from 'react-simple-star-ratings';
import './App.css'

function App() {
  const starArray = [1, 2, 3, 4, 5];

  const starArrayTag = [
    { st: 1, tag: "Terrible" },
    { st: 2, tag: "Bad" },
    { st: 3, tag: "Average" },
    { st: 4, tag: "Great" },
    { st: 5, tag: "Awesome" },
  ];

  return (
    <>
      <h1>Star Rating in React</h1>
      <StarRating tooltipArray={starArray} />

      <TagStarRating
        allowTitleTag={true}
        tooltipDefaultText
        tooltipArray={starArrayTag}
      />

      // There are Different Types of React Components
      // Availave in the Demo please Visit !!!
    </>
  )
}

export default App;

Available Props

| Prop | Type | Options | Description | Default | | -------------------- | ---------------- | -------- | --------------------------------------------------------- | :------------------------: | | onClick | function | Optional | callback with hover, index and event values passed | - | | onMouseOver | function | Optional | callback with event passed | - | | onMouseLeave | function | Optional | callback with event passed | - | | initialValue | number | Optional | Set initial value | 0 | | iconsCount | number | Optional | Number of the icons | 5 | | transition | boolean | Optional | Adds a smooth transition effect on mouse hover | false | | className | string | Optional | Applied to the main span | react-simple-star-rating | | style | CSSProperties | Optional | Inline style applied to the main span | basic style | | emptyStyle | CSSProperties | Optional | Inline style applied to empty icon span | basic style | | emptyClassName | string | Optional | Applied to the empty icon span | empty-icons | | customIcons | array of object | Optional | Add a group of icons | [] | | allowHover | boolean | Optional | Enable / Disable hover effect | true | | disableFillHover | boolean | Optional | Enable / Disable hover effect on filled stars | false | | allowTitleTag | boolean | Optional | Enable / Disable HTMLtitle Tag | true | | showTooltip | boolean | Optional | Show a tooltip with live values | false | | tooltipDefaultText | string | Optional | Initial tooltip text if no rating value | Your Rate | | tooltipArray | array | Optional | Array of strings to show inside tooltip | [] | | tooltipClassName | string | Optional | Tooltip CSS class | rating-tooltip |

Demo

React Simple Star Ratings.


License

Apache License 2.0 © SURAJPATIL6088