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

star-rate-component

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

star-rate-component

A very simple component for star rating in Vue.js

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Star Rate Component

NPM version GitHub version Software License

Star Rate Component

A simple component for VueJS. Star Rate Component is a component for VueJS for evaluating items through stars with or without punctuation. A customizable component in a simple and intuitive way with a sophisticated and good design.

Installation

Download (Zip)

Download this link.

Build

Clone this repository

$ git clone https://github.com/thalysonalexr/star-rate-component.git

NPM

Install the latest version by npm

$ npm install --save star-rate-component@latest

Get Started

Basic usage

Note: In your App.vue import

<template>
  <v-star-rate ref="component" />
</template>

<script>
import StarRate from 'star-rate-component'

export default {
  name: 'App',
  components: {
    // name of component star rate
    'v-star-rate': StarRate
  }
}
</script>
Basic usage

Get value of rating

Get a value of component by $refs in data: "note"

<script>
(...)
export default {
  (...)
  methods: {
    show () { console.log(this.$refs.component.note) }
  }
}
</script>
...

Set the size of the component

In property size

<template>
  <div>
    <v-star-rate ref="component1" size="sm" />
    <v-star-rate ref="component2" size="md" />
    <v-star-rate ref="component3" size="lg" />
  </div>
</template>
Size of component

Properties

PropertyTypePossible valuesDescriptionRemarks
color-boxStringcolors in rgb, rgba or hexadecimalColor for container box in componentNo required, default: #fcfcfc
color-textStringcolors in rgb, rgba or hexadecimalColor of pontuation and titleNo required
default-color-starStringcolors in rgb, rgba or hexadecimalColor of star deselectedNo required, default: #dbdbdb
bordersBooleantrue or falseBorder in container of component (box)No required, default: true
shineBooleantrue or falseFlashing stars animationNo required, default: false
displayStringsimple or normalSimple container without punctuation and without title. Normal container with punctuation. Container full with punctuation and titleNo required, default: full
title-boxStringAnywhere valueTitle in container box componentNo required
resultArrayValues type numberAn array with number-type values ​​of each star-rate-component component for generating an average in this result containerNo required
sizeStringsm, md or lgComponent container sizeNo required, default: md
labelsObjectAnywhere value in keys objectTitle labels of each star in the assessmentNo required, default: {terrible: 'terrible', bad: 'bad', good: 'good', great: 'great', perfect: 'perfect'}

Credits

License

MIT License © 2018 - 2020 Made with ♥ by Thalyson Rodrigues

Keywords

FAQs

Package last updated on 18 Jun 2020

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