4.2.0 • Published 5 years ago

material-ui-rating v4.2.0

Weekly downloads
8,582
License
MIT
Repository
github
Last release
5 years ago

Material-UI Rating

JavaScript Style Guide Build Status

Example

Installation

Stable channel

npm install material-ui-rating@next

Usage

import Rating from 'material-ui-rating'

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

Material Rating Properties

NameTypeDefaultDescription
classes*objectUseful to extend the style applied to components. The accepted keys are listed below.
componentelementTypedivThe component used for the root node. Either a string to use a DOM element or a component.
disabledboolfalseDisables the rating and gray it out if set to true.
disableHoverboolfalseDisable hover effects if set to true.
iconFillednodeThis is the icon to be used as an icon in value range.
iconFilledRendererfuncOverrides filled icon renderer.
iconHoveredRendererfuncOverrides hovered icon renderer.
iconHoverednodeThis is the icon to be used as an hovered icon.
iconNormalnodeThis is the icon to be used as an normal icon.
iconNormalRendererfuncOverrides normal icon renderer.
maxnumber5The max value of the rating bar.
onChangefuncFired when a value is clicked.
readOnlyboolfalseDon't allow input if set to true.
valuenumber0The 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, this package respects theme.direction.rtl, so right-to-left support works out-of-the-box.

License

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

4.2.0

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

4.0.0-beta.2

5 years ago

3.1.1

5 years ago

4.0.0-beta.1

5 years ago

3.1.0

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

6 years ago

2.0.0-beta.2

6 years ago

1.4.1

6 years ago

2.0.0-beta.1

6 years ago

1.4.0

7 years ago

1.3.2

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago