# material-ui-rating

> Material style rating

Latest version **4.2.0** (published 2019-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install material-ui-rating
pnpm add material-ui-rating
yarn add material-ui-rating
bun add material-ui-rating
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.2.0 |
| Published | 2019-08-14 |
| First published | 2017-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 334.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 88 |
| Author | Wertarbyte |
| Maintainers | evidence, lemaik, redbeard0091, saschb2b |
| Keywords | react, material, material-ui, rating, react-component |

## Links

- npm: https://www.npmjs.com/package/material-ui-rating
- Repository: https://github.com/TeamWertarbyte/material-ui-rating
- Homepage: https://github.com/TeamWertarbyte/material-ui-rating#readme
- Issues: https://github.com/TeamWertarbyte/material-ui-rating/issues
- npm.io page: https://npm.io/package/material-ui-rating

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.8

## 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

- 4.2.0 (latest) — 2019-08-14
- 4.0.0-beta.2 (next) — 2019-04-29
- 1.4.1 (legacy) — 2017-12-16
- 4.1.1 — 2019-06-30
- 4.1.0 — 2019-06-17
- 4.0.0 — 2019-06-13
- 3.1.1 — 2019-04-29
- 4.0.0-beta.1 — 2019-04-28
- 3.1.0 — 2019-04-07
- 3.0.1 — 2019-03-05
- 3.0.0 — 2019-02-12
- 2.0.0 — 2018-04-27
- 2.0.0-beta.2 — 2018-03-07
- 2.0.0-beta.1 — 2017-11-06
- 1.4.0 — 2017-10-24
- … 6 more at https://npm.io/package/material-ui-rating/versions

## README

# Material-UI Rating
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Build Status](https://travis-ci.org/TeamWertarbyte/material-ui-rating.svg?branch=next)](https://travis-ci.org/TeamWertarbyte/material-ui-rating)

![Example](preview.gif)

## Installation

**Stable channel**
```sh
npm install material-ui-rating@next
```

## Usage
```js
import Rating from 'material-ui-rating'

<Rating
  value={3}
  max={5}
  onChange={(value) => console.log(`Rated with value ${value}`)}
/>
```

### Material Rating Properties

|Name               |Type    |Default|Description                                                                          |
|-------------------|--------|-------|-------------------------------------------------------------------------------------|
|classes*           |`object`|       |Useful to extend the style applied to components. The accepted keys are listed below.|
|component          |`elementType`|`div`|The component used for the root node. Either a string to use a DOM element or a component.|
|disabled           |`bool`  |`false`|Disables the rating and gray it out if set to true.                                  |
|disableHover       |`bool`  |`false`|Disable hover effects if set to true.                                                        |
|iconFilled         |`node`  |       |This is the icon to be used as an icon in value range.                               |
|iconFilledRenderer |`func`  |       |Overrides filled icon renderer.                                                      |
|iconHoveredRenderer|`func`  |       |Overrides hovered icon renderer.                                                     |
|iconHovered        |`node`  |       |This is the icon to be used as an hovered icon.                                      |
|iconNormal         |`node`  |       |This is the icon to be used as an normal icon.                                       |
|iconNormalRenderer |`func`  |       |Overrides normal icon renderer.                                                      |
|max                |`number`|`5`    |The max value of the rating bar.                                                     |
|onChange           |`func`  |       |Fired when a value is clicked.                                                       |
|readOnly           |`bool`  |`false`|Don't allow input if set to true.                                                    |
|value              |`number`|`0`    |The value of the rating bar.                                                         |

\* required property


### CSS API

You can override all the class names injected by Material-UI-Rating thanks to the `classes` property. This property accepts the following keys:

- `root` - Applied to the root `div` element
- `iconButton` - Applied to the IconButton component
- `icon` - Applied to the SvgIcon component
- `disabled` - Applied to the IconButton component when disabled prop is `true`
- `readOnly` - Applied to the IconButton component when readOnly prop is `true`

## RTL support

Following [Material-UI's conventions](https://material-ui.com/guides/right-to-left/), this package respects [`theme.direction.rtl`](https://material-ui.com/customization/default-theme/), so right-to-left support works out-of-the-box.

## License

The files included in this repository are licensed under the MIT license.

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