Socket
Socket
Sign inDemoInstall

beauty-stars

Package Overview
Dependencies
8
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    beauty-stars

A simple and beauty star rating for React projects


Version published
Weekly downloads
196
increased by30.67%
Maintainers
1
Install size
24.3 kB
Created
Weekly downloads
 

Readme

Source

Welcome to beauty-stars 👋

Coverage Status npm version License: MIT Twitter: leocardoso94_

A simple and beauty star rating for React projects

Install

npm install --save beauty-stars
// or
yarn add beauty-stars

Usage

import React, { Component } from "react";

import BeautyStars from "beauty-stars";

export default class App extends Component {
  state = { value: 0 };
  render() {
    return (
      <BeautyStars
        value={this.state.value}
        onChange={value => this.setState({ value })}
      />
    );
  }
}

API

This a list of props that you can pass down to the component:

PropertyDescriptionDefault valuetype
maxStarsHow many total stars you want5number
valueSet rating value0number
editableEnable edittrueboolean
inactiveColorColor of inactive star (this supports any CSS valid value)#121621string
activeColorColor of selected or active star#FFED76string
sizeSize of stars (in px)36pxstring
onChange(newValue)Will be invoked any time the rating is changedundefinedfunction
hideInactiveWill hide inactive starsfalseboolean
gapSets the gaps (gutters) between stars16pxstring

Author

👤 Leocardoso94

Show your support

Give a ⭐️ if this project helped you!

FAQs

Last updated on 14 Feb 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc