New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-star-rating

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-star-rating

A simple star rating component built with React.

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
424
decreased by-33.44%
Maintainers
1
Weekly downloads
 
Created
Source

react-star-rating

A simple star rating component built with React.

Install

CommonJS/Browserify
$ npm install react-star-rating --save
Bower/AMD
$ bower install react-star-rating --save
Browser
<link rel="stylesheet" href="path/to/react-star-rating.min.css">
<script src="http://fb.me/react-0.12.2.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/JSXTransformer.js"></script>
<script src="path/to/react-star-rating/react-star-rating.min.js"></script>
<script>
// window.StarRating
</script>

Usage

var FormComponent = React.createClass({
    render: function () {
      return (
        <form action="/" method="GET">
          <StarRating name="airbnb-rating" caption="Rate your stay!" ratingAmount={5} />
          <button type="submit" className="btn btn-submit">Submit Rating</button>
        </form>
      );
    }
});

React.render(<FormComponent />, document.getElementById('star-rating')'}</p>

Options

  • name={string} - name for form input (required)
  • caption={string} - caption for rating (optional)
  • ratingAmount={number} - rating amount (required, default: 5)
  • rating={number} - a set rating between the rating amount (optional)
  • disabled={boolean} - whether to disable the rating from being selected (optional)
  • editing={boolean} - whether the rating is explicitly in editing mode (optional)
  • size={string} - size of stars (optional)
  • onRatingClick={function} - a handler function that gets called onClick of the rating (optional) - gets passed (event, {position, rating, caption, name})

License

MIT

FAQs

Package last updated on 08 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc