Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ikr/react-star-rating-input
React.js components for entering 0—N stars (N is 5 by default), or displaying 0—N stars
https://github.com/ikr/react-star-rating-input
Last synced: about 2 months ago
JSON representation
React.js components for entering 0—N stars (N is 5 by default), or displaying 0—N stars
- Host: GitHub
- URL: https://github.com/ikr/react-star-rating-input
- Owner: ikr
- License: mit
- Created: 2014-09-18T10:24:42.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-02T13:16:40.000Z (over 6 years ago)
- Last Synced: 2024-04-14T21:54:26.123Z (8 months ago)
- Language: TypeScript
- Homepage:
- Size: 244 KB
- Stars: 54
- Watchers: 5
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-components-all - react-star-rating-input - React.js component for entering 0-5 (or more) stars. (Uncategorized / Uncategorized)
- awesome-react-components - react-star-rating-input - React.js component for entering 0-5 (or more) stars. (UI Components / Form Components)
- awesome-react - react-star-rating-input - React.js component for entering 0-5 (or more) stars. ![](https://img.shields.io/github/stars/ikr/react-star-rating-input.svg?style=social&label=Star) (UI Components / Form Components)
- awesome-list - react-star-rating-input - React.js component for entering 0-5 (or more) stars. (Demos / Form Components)
- awesome-react-components - react-star-rating-input - React.js component for entering 0-5 (or more) stars. (UI Components / Form Components)
- awesome-react-components - react-star-rating-input - React.js component for entering 0-5 (or more) stars. (UI Components / Form Components)
- awesome-react-components - react-star-rating-input - React.js component for entering 0-5 (or more) stars. (UI Components / Form Components)
- fucking-awesome-react-components - react-star-rating-input - React.js component for entering 0-5 (or more) stars. (UI Components / Form Components)
README
[![Build Status](https://travis-ci.org/ikr/react-star-rating-input.svg?branch=master)](https://travis-ci.org/ikr/react-star-rating-input)
# About
React.js components for entering 0—N stars (N is 5 by default), or displaying 0—N stars. See [the
demo](http://ikr.su/h/react-star-rating-input/demo.html).It's published to npm compiled to ES5, and should work in IE11, if `Promise` gets polyfilled.
# Installation
npm install --save react-star-rating-input
The two main exports are: `{StarRatingInput, StarRating}`. The former is for an interactive input
control, the latter is for passive star rating display. Star rasters and CSS is exported as the
`{css}` string.# Usage
See [the code](https://github.com/ikr/react-star-rating-input/blob/master/src/demo.tsx) of the demo
mentioned above.## StarRatingInput props
Static layout
* `size` — how many stars to display. The default value is 5
Interaction
* `value` — how many stars are selected
* `onChange: (value: number) => void` — your `value` change handler## StarRating props
* `value` — how many stars are displayed