1.0.0 • Published 3 years ago

@shapla/vue-star-rating v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

shapla-star-rating

A simple, highly customisable star rating component for Vue 3

Table of contents

Installation

npm install --save @shapla/vue-star-rating

Usage

Styles

with Sass:

import '@shapla/vue-star-rating/src/index.scss';

with CSS:

import '@shapla/vue-star-rating/dist/style.css';

Javascript Instantiation

import ShaplaStarRating from '@shapla/vue-star-rating';

export default {
  name: 'Hello',

  components: {
    ShaplaStarRating
  },
  data() {
    return {
      rating: 4,
      staticRating: 4.6,
    }
  }
}
<shapla-star-rating v-model="rating"/>

<shapla-star-rating v-model="staticRating" :is-static="true"/>

Props

PropertyTypeRequiredDefaultDescription
valueNumberyes | The initial rating
is-staticBooleannofalseIf set true, the rating cannot be edited.
colorStringno | The color of the non-highlighted portion of a star.
active-colorStringno | The color of the highlighted portion of a star.
ratingsArrayno[1, 2, 3, 4, 5]List of rating value