# react-rate-component

> react rating component with custom symbol

Latest version **1.0.2** (published 2019-02-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-rate-component
pnpm add react-rate-component
yarn add react-rate-component
bun add react-rate-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-02-10 |
| First published | 2019-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 44.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ebru Gulec |
| Maintainers | ebrugulec |
| Keywords | rating, react, component, react-component, react-hooks |

## Links

- npm: https://www.npmjs.com/package/react-rate-component
- Repository: https://github.com/ebrugulec/react-rate-component
- Homepage: https://github.com/ebrugulec/react-rate-component#readme
- Issues: https://github.com/ebrugulec/react-rate-component/issues
- npm.io page: https://npm.io/package/react-rate-component

## Dependencies (1)

- [react-scripts](https://npm.io/package/react-scripts.md) 2.1.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-02-10
- 1.0.1 — 2019-02-10
- 1.0.0 — 2019-02-09

## README

# react-rate-component :star:
React Hooks Rate Component
[![npm version](https://badge.fury.io/js/react-rate-component.svg)](https://www.npmjs.com/package/react-rate-component/)

## Demo
> React Rate Component - [Demo](https://github.com/ebrugulec/react-rate-component)

## Install

```bash
    npm install react-rate-component --save
```

## Usage
```javascript
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

| Property | Description | Default value | Type |
| -------- | ----------- | ------------- | ---- |
| `count`  | Total symbol count  | 5 | number |
| `edit` | You can make disable your rate symbols | `true` | boolean |
| `showCount`  | Set rating value  | `false` | boolean |
| `defaultValue`  | Set rating default value  | 0 | number |
| `symbol` | Which character you want to use | ★ | string |
| `size` | Size of symbol (px) | `25px` | string |
| `activeColor` | Color of selected or active symbols | `#ffd700` | string |
| `inactiveColor` | Color of inactive symbols | `#949494` | string |

## Callbacks

| Callback | Description | Type |
| -------- | ----------- | ------------- | ---- |
| `onChange(new_rating)` | Will be invoked any time the rating is changed | function (value) {} |

### Todo
* Write tests

License
MIT

---
_Source: https://npm.io/package/react-rate-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
