react-rating-stats

0.1.4 • Public • Published

react-rating-stats

Build Status npm

React rating stats component based on JSS

Demo

cd demo
npm install
npm start

Usage

npm install react-rating-stats
import React from 'react'
import { render } from 'react-dom'
import { ThemeProvider } from 'react-jss'
import Rating, { theme } from 'react-rating-stats'
 
const App = () => (
  <ThemeProvider theme={theme}>
    <Rating values={[4022004, 1654689, 3923104, 9105819, 42660181]} />
  </ThemeProvider>
)
 
render(<App />, document.getElementById('root'))    

Exports

Rating (default)

Package default export, aligns components Score and Histogram

  • values – Array of integer rating counters
<Rating values={[4022004, 1654689, 3923104, 9105819, 42660181]} />

Score

  • values – Array of integer rating counters
<Score values={[4022004, 1654689, 3923104, 9105819, 42660181]} />

Histogram

  • values – Array of integer rating counters
<Histogram values={[4022004, 1654689, 3923104, 9105819, 42660181]} />

Stars

  • value – Integer number [0, max] of current rating
  • max – Integer maximum number of stars
  <Stars value={4} max={8} />

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i react-rating-stats

Weekly Downloads

2

Version

0.1.4

License

MIT

Last publish

Collaborators

  • dhwk