rc-rate
React Star Rate Component
Last updated 9 years ago by yiminghe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install rc-rate 
SYNC missed versions from official npm registry.

rc-rate

React Rate Component

NPM version npm download build status Codecov bundle size dumi

Screenshots

Changelog

Development

npm install
npm start

Example

install

rc-rate

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import Rate from 'rc-rate';

ReactDOM.render(
  <Rate />,
  document.getElementById('root')
)

with styled-components

import React from 'react';
import ReactDOM from 'react-dom';
import Rate from 'rc-rate';
import styled from 'styled-components';

const StyledRate = styled(Rate)`
  &.rc-rate {
    font-size: ${({ size }) => size}px;
  }
`

ReactDOM.render(
  <StyledRate size="24" />,
  document.getElementById('root')
)

API

props

name type default description
count number 5 Star numbers
value number - Controlled value
defaultValue number 0 Initial value
allowHalf boolean false Support half star
allowClear boolean true Reset when click again
style object {}
onChange function (value) => {} onChange will be triggered when click
onHoverChange function (value) => {} onHoverChange will be triggered when hover on stars
character ReactNode | (props) => ReactNode The each character of rate
disabled boolean false
direction string ltr The direction of rate

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-rate is released under the MIT license.

Current Tags

  • 2.13.0                                ...           latest (7 months ago)

32 Versions

  • 2.13.0                                ...           7 months ago
  • 2.9.3                                ...           a year ago
  • 2.12.0                                ...           2 years ago
  • 2.11.2                                ...           2 years ago
  • 2.11.1                                ...           2 years ago
  • 2.11.0                                ...           2 years ago
  • 2.10.0                                ...           2 years ago
  • 2.9.2                                ...           3 years ago
  • 2.9.1                                ...           4 years ago
  • 2.9.0                                ...           4 years ago
  • 2.8.2                                ...           5 years ago
  • 2.8.1                                ...           5 years ago
  • 2.8.0                                ...           5 years ago
  • 2.7.0                                ...           5 years ago
  • 2.6.0                                ...           5 years ago
  • 2.5.1                                ...           5 years ago
  • 2.5.0                                ...           6 years ago
  • 2.4.3                                ...           6 years ago
  • 2.4.2                                ...           6 years ago
  • 2.4.1                                ...           6 years ago
  • 2.4.0                                ...           7 years ago
  • 2.3.0                                ...           7 years ago
  • 2.2.0                                ...           7 years ago
  • 2.1.1                                ...           8 years ago
  • 2.1.0                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.1.2                                ...           9 years ago
  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE