Giter Site home page Giter Site logo

trmcnvn / ember-star-rating Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 9.0 5.28 MB

:star: An ember.js component for star ratings using svgs!

Home Page: http://vevix.net/ember-star-rating

License: MIT License

JavaScript 84.83% HTML 15.17%
emberjs ember-addon rating stars svg

ember-star-rating's Introduction

ember-star-rating

npm version Build Status FOSSA Status

Ember.js component for ratings.

Check out the dummy app here

Installing the Add-on

  • Ember.js v3.4 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

In your application's directory:

$ ember install ember-star-rating

Using the Add-on

Use the component in your template:

<StarRating @rating={{rating}} />

or with positional params.

{{star-rating rating}}

Configuration

Option Type Default Info
rating Number 0 The current rating value
numStars Number 5 The number of "stars" to render
readOnly Boolean false Whether the component can be edited or not
anyPercent Boolean false Allow setting a rating to any percentage. Example: 3.2
wholeOnly Boolean false Only allow integer rating values. Example: 1 - 5
useHalfStars Boolean true Allow half rating values. Example: 2.5
onHover Function NOOP Called on the mouseMove and mouseLeave events with the rating value at the time.
onClick Function NOOP Called when the user selects a rating value. This is still invoked when readOnly is set to true
width Number 26 Width of the SVG element
height Number 26 Height of the SVG element
viewBox String '0 0 26 26' ViewBox of the SVG element
svgPath String '...' Path value of the SVG element
fillColor String 'yellow' Color of the SVG element that is considered full (has a rating)
baseColor String 'lightgrey' Color of the SVG element that is considered empty

License

See LICENSE.md

FOSSA Status

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.