1.0.2 • Published 5 years ago

react-rate-component v1.0.2

Weekly downloads
20
License
MIT
Repository
github
Last release
5 years ago

react-rate-component :star:

React Hooks Rate Component npm version

Demo

React Rate Component - Demo

Install

    npm install react-rate-component --save

Usage

import ReactRateComponent 'react-rate-component'

class Foo extends Component {
    changeRating(newRating) {
      setRate(newRating)
    }

    render() {
      return (
        <ReactRateComponent
            defaultValue={3}
            showCount={true}
            onChange={this.changeRating}
        />
      );
    }
}

class Bar extends Component {
  render() {
    return (
        <ReactRateComponent />
    );
  }
}

Properties

PropertyDescriptionDefault valueType
countTotal symbol count5number
editYou can make disable your rate symbolstrueboolean
showCountSet rating valuefalseboolean
defaultValueSet rating default value0number
symbolWhich character you want to usestring
sizeSize of symbol (px)25pxstring
activeColorColor of selected or active symbols#ffd700string
inactiveColorColor of inactive symbols#949494string

Callbacks

CallbackDescriptionType
onChange(new_rating)Will be invoked any time the rating is changedfunction (value) {}

Todo

  • Write tests

License MIT

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago