/autoform-switchery

Custom Switchery Boolean Input for AutoForm (Meteor)

Primary LanguageJavaScriptMIT LicenseMIT

mayankchhabra:autoform-switchery

An add-on Meteor package for aldeed:autoform. Provides a single custom input type for Boolean values, "switchery", which renders using the switchery plugin.

Prerequisites

AutoForm

In a Meteor app directory, enter:

$ meteor add aldeed:autoform

Installation

In a Meteor app directory, enter:

$ meteor add mayankchhabra:autoform-switchery

Usage

Specify "switchery" for the type attribute of a Boolean input. This can be done in a number of ways:

In the schema, which will then work with a quickForm or afQuickFields:

{
  approve: {
    type: Boolean,
    autoform: {
      type: "switchery"
    }
  }
}

Contributing

Anyone is welcome to contribute. Fork, make your changes, and then submit a pull request.