1.1.0 ā€¢ Published 4 years ago

beauty-stars v1.1.0

Weekly downloads
409
License
MIT
Repository
github
Last release
4 years ago

A simple and beauty star rating for React projects

npm.io

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 stars16pxstringnumber

Author

šŸ‘¤ Leocardoso94

Show your support

Give a ā­ļø if this project helped you!

1.1.0

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago