Socket
Socket
Sign inDemoInstall

vue-js-star-rating

Package Overview
Dependencies
11
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-js-star-rating

Vue fontawesome icons rating


Version published
Weekly downloads
44
increased by51.72%
Maintainers
1
Install size
2.49 MB
Created
Weekly downloads
 

Readme

Source

Vue.js fontawesome icon rate component

It's easy to use Vue.js component for star rating!

  1. This package is fully customized (Shape, Color, Rate, ...).
  2. I used Vue font awesome.
  3. You can change your rating shape with free and open source font awesome project.

vue-js-star-rating

Install package

  1. Install with npm npm i vue-js-star-rating --save
  2. Install with yarn yarn add vue-js-star-rating --save

Code sample

After import and registering component in your Vue.js application:

<template>
  <div>
    <vue-star-rate
      :rateRange="3"
      :maxIcon="5"
      :iconHeight="22"
      :iconWidth="22"
      :hasCounter="true"
      iconColor="#FFFF99"
      iconColorHover="#FFFF99"
      iconShape="star"
    ></vue-star-rate>
  </div>
</template>

<script>
import vueStarRate from "vue-js-star-rating";
export default {
  components: { vueStarRate }
};
</script>

Documents

AttributeDescriptionTypeDefault
rateRangeNumber of active iconNumber3
maxIconNumber of iconsNumber5
iconHeightIcon heightNumber45
iconWidthIcon widthNumber45
hasCounterCounter like 3 of 5Booleantrue
iconColorColor of iconString#f3d23e
iconColorHoverColor of hover iconString#f3d23e
iconShapeShape of icon like star, heart, etcStringstar
ratingSetEvent after click on iconEventnull

Events

When a star is clicked, an event is emitted called ratingSet. You can listen for this event to get the value of the rating.

<template>
  <div>
    <vue-star-rate v-on:ratingSet="myRatingMethod"></vue-star-rate>
  </div>
</template>

<script>
import vueStarRate from "vue-js-star-rating";
export default {
  components: { vueStarRate },
  methods: {
    myRatingMethod(rating) {
      console.log("The selected rating is " + rating);
    }
  }
};
</script>

Keywords

FAQs

Last updated on 07 Oct 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc