Socket
Socket
Sign inDemoInstall

vue-five-star-input

Package Overview
Dependencies
16
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-five-star-input

vuejs five star rating input


Version published
Weekly downloads
6
increased by500%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vue-five-star-input

Use this Five Star Input in your vue projects to easily get user input using stars. You can easily adjust the colour and height of the star icons to fit your project. Use the name prop to give your input field a name for the form you put it in. It uses a hidden input field with that name and the value of the stars selected.

Project setup

npm install --save vue-five-star-input

Usage

Import into your Vue project

import FiveStarInput from 'vue-five-star-input';
export default { 
    components: {
        FiveStarInput,
    }
}

Use in your project

<five-star-input name="customer-review" value="3" />

Props:

name: The name of the input field

value: (optional) Default value of the five stars (0-5)

required: (optional. default=false). Boolean whether the input field is required

Styling:

Style the stars using the .star class. You can change the color and height of the icons.

Example

image of five star input asking for a review

<template>
  <div id="app">
    <p>Please rate your experience</p> 
    <five-star-input name="test" value="3" :required="true"/>
  </div>
</template>

<script>
import FiveStarInput from 'vue-five-star-input'
export default {
  components: {
    FiveStarInput
  }
}
</script>

<style>
...
.star {
  color: goldenrod;
  height: 30px;
}
</style>

FAQs

Last updated on 14 Jan 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc