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 🙏

© 2026 – Pkg Stats / Ryan Hefner

v-data-form

v1.0.2

Published

A vue form whose UI and behaviour are only determined by the data input in it.

Readme

v-data-form Build Status

A vue form whose UI and behaviour are only determined by the data input in it.

Demo

Checkout the demo

Dependencies

  1. Vuejs +v2.6.10
  2. Vuetify +v1.5.5

Usage

Don't use just yet. We are still building!

Installation

  1. You can get this as an NPM package in your app

    npm install --save v-data-form
  2. Go to your vuetify.js plugin file in your plugin folder (Vuetify is needed for this) and import and register v-data-form globally

     import VDataForm from "v-data-form";
    
     Vue.use(Vuetify, {
       iconfont: "md"
     });
    
     Vue.component("v-data-form", VDataForm);
  3. In any of your component templates, just use the <v-data-form></v-data-form> tags e.g.

    <v-data-form v-model="yourData"></v-data-form>

Data Schema

The form receives props:

  • value (or 'v-model' if you wish)
  • styleObj
  • submissionButtonLabel (submission-button-label in template syntax)
  • cancellationButtonLabel (cancellation-button-label in template syntax)
props: {
  value: [ // Array of objects with properties; 'type', 'name', 'value', 'options'
    /* e.g.
    {
      type: "text-field", value: "hello world", name: 'greetingInput',
      options: {
        style: {color: "blue"},
        onclick: () => alert('clicked')
      }
    },
    {
      type: "autocomplete", value: "", name: 'district',
      options: {
        items: ['Hoima', 'Kampala', 'Wakiso'],
      },
    },
    {
      type: "radio-group",
      value: "Kampala",
      children: [
        { type: "radio", value: "Kampala", options: { label: "Kampala" } },
        { type: "radio", value: "Jinja", options: { label: "Jinja" } }
      ]
    }
    */
  ],
  styleObj: { // CSS style
    /*e.g.
    "background-color": "#fff"
    */
  },
  submissionButtonLabel: '', // Defaults to 'submit'
  cancellationButtonLabel: '', // Defaults to 'cancel'
}

Each item in the 'formData' property (shown above), must have at least two properties; the type and the name:

  • 'text-field'
  • 'textarea'
  • 'select'
  • 'autocomplete'
  • 'switch'
  • 'radio'
  • 'radio-group'
  • 'combobox'
  • 'checkbox'

More are being added to the list.

It can also have three other properties; value, options and children

Each child element can also have a name, type, options and other children.

Output

The form has a property called formOutput which is an object holding the values of each element in the form, the keys being the names of those elements.

For example, basing on the example 'formData' property of the props in the code section under 'Data Schema', here is the formOutput

output: {
  greetingInput: 'hello world',
  district: 'Kampala', // In case the user selected Kampala
}

Events

The form emits two major events.

An example of what the handers would look like in say a 'methods' section of the parent component, is shown below:

methods: {
    submissionHandler: (formOutput) => {
      /* Do Something on submission
      (i.e. after SUBMIT button is clicked)*/
      /* formOutput is the data output of the form:
      It is kind like the form-data that is sent to the server
      by HTML forms using the signature {[nameOfInput: string]: value}
      */
    },
    cancellationHandler: (formOutput) => {
      /* Do something on cancellation
      (i.e. after CANCEL button is clicked)*/
      /* formOutput is the data output of the form:
      It is kind like the form-data that is sent to the server
      by HTML forms using the signature {[nameOfInput: string]: value}
      */
    }
}

The formOutput is accessible to the 'submit' and 'cancel' event handlers.

Acknowledgements

Vuetify is the component library this form is based on.

This post by Divyam Rastogi was very helpful when publishing to NPM.

License

Copyright (c) 2019 Martin Ahindura Licensed under the MIT License