Socket
Socket
Sign inDemoInstall

vue-dynamic-star-rating

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-dynamic-star-rating

A highly dynamic vue stars rating component, similar to google play stars rating


Version published
Weekly downloads
45
decreased by-30.77%
Maintainers
1
Weekly downloads
 
Created
Source

vue-dynamic-star-rating

A Highly Customizable, easy-to-use elegant stars rating component (similar to Google Play)

Feedback would be much appreciated, questions, suggestions, issues are more than welcome.

Demo

alt text

Edit Vue Template

Usage

Install via NPM npm i vue-dynamic-star-rating

Then require in your project:

var StarRating = require('vue-dynamic-star-rating');

or ES6 syntax:

import StarRating from 'vue-dynamic-star-rating'

Then you can register the component globally:

Vue.component('star-rating', StarRating);

Or in your Vue component:

components: {
  StarRating
}

You can then use the following selector anywhere in your project:

  • To get up and running quick the package now supports rendering just the selector with default values
<star-rating></star-rating>

Docs

config: {...} is a configuration object that is to be binded to vue-star-rating, api properties are:

Basics

PropertyTypeDescriptionDefault
ratingnumberA number between 0.0-5.0 that will determine the fullness of the 5-stars rating polygons1

Customized Styling

PropertyTypeDescriptionDefault
fullStarColorstringSet the full or partially-full star color#ed8a19
emptyStarColorstringSet the empty or partially-empty star color#737373
starWidthnumberSet the star width20
starHeightnumberSet the star height20

Implementation Example

Define your config options object in the component importing StarRating e.g

data: function() {
    return {
        config: {
            rating: 4.7,
            style: {
                fullStarColor: '#ed8a19',
                emptyStarColor: '#737373',
                starWidth: 30,
                starHeight: 30
            }
        }
    }
}

And bind it to the selector like so

<vue-dropdown :config="config"></vue-dropdown>

Keywords

FAQs

Package last updated on 29 Dec 2018

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