npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-formulate-star-rating

v1.1.16

Published

Use vue-star-rating as a custom input in Vue Formulate forms.

Downloads

36

Readme

Vue Formulate Star Rating Input

Version Shield Licence Shield

A simple wrapper component for the excellent vue-star-rating package by craigh411.

This component allows you to use a star rating as a custom input as a Vue Formulate Plugin.

Installation

Using NPM and webpack

  1. npm install --save vue-formulate-star-rating

  2. Register the component

    import Vue from "vue";
    import VueFormulate from "@braid/vue-formulate";
    
    import VueFormulateStarRating from "vue-formulate-star-rating";
    
    // add plugin to VueFormulate
    Vue.use(VueFormulate, {
      plugins: [VueFormulateStarRating],
    });
  3. Use in a Formulate form

    <FormulateInput
      type="star-rating"
      name="productRating"
      label="Rate this product"
      help="How would you rate this product?"
      :max-rating="5"
      :show-rating="false"
      validation="required|min:4"
    />

Using script tags

  1. Include the vue-formulate-star-rating.
    <script src="https://unpkg.com/vue-formulate-star-rating/dist/VueFormulateStarRating.umd.min.js"></script>
  2. Register a custom Formulate input
    Vue.use(VueFormulate, {
      plugins: [VueFormulateStarRating.default],
    });
  3. Use in your form
    <formulate-input type="star-rating" label="Product rating" name="rating" help="Rate this" :show-rating="false" validation="required"></formulate-input>

Note: as per the Vue Formulate docs:

Due to DOM limitations, when mounting Vue Formulate in DOM templates (outside of single-file components) all the component names will need to be lower-cased, hyphen separated and with a closing tag.

Usage

You can pass props to the input, they will be bound using v-bind.

See vue-star-rating documentation for list of available props.

Validation rules work as normal.

For example, this would set the max rating to 10 and hide the rating, while requiring a minimum rating of 4:

   <FormulateInput
     type="rating"
     name="productRating"
     label="Rate this product"
     help="How would you rate this product?"
     :max-rating="10"
     :show-rating="false"
     validation="required|min:4"
   />

Contribute

Contributions and issues welcome, please file a PR or raise an issue on GitHub.

Development

  • npm install
  • make your changes
  • npm run build
  • npm version patch
  • npm publish