Dynamic Vue Star Rating Component

Install & Download:

# NPM
$ npm i vue-dynamic-star-rating

Description:

A dynamic star rating Vue component inspired by Google Play.

How to use it:

1. Import and register the star rating component.

import StarRating from 'vue-dynamic-star-rating'
Vue.component('star-rating', StarRating);
// OR
components: {
  StarRating
}

2. Add the star rating component to the app.

<stars-rating v-bind="config"></stars-rating>
export default {
  name: "App",
  components: {
    starsRating: starsRating
  },
  data() {
    return {
      config: {
        rating: 4.7,
        isIndicatorActive: true,
        starStyle: {
          fullStarColor: "#ed8a19",
          emptyStarColor: "#737373",
          starWidth: 100,
          starHeight: 100
        }
      }
    };
  },
  computed: {},
  methods: {},
  created() {}
};

Preview:

Dynamic Vue Star Rating Component

Tags:

Add Comment