Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-js-star-rating

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-js-star-rating

Vue fontawesome icons rating

  • 1.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
63
increased by61.54%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 07 Oct 2021

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