brick-form

A Brick form component which uses a brick-storage component to store its content.

Demo

Check it live!

Usage

  1. Import Web Components polyfill:

     <script src="bower_components/platform/platform.js"></script>
    
  2. Import Custom Element:

     <link rel="import" href="src/brick-form.html">
    
  3. Start using it:

     <brick-storage-indexeddb id="store" key="group"></brick-store-indexeddb>
     <brick-form storage="store" name="a">... inputs ...</brick-form>
    

Options

Attribute Options Default Description
name string The name of the form. Will be used to identify the forms data in the datastore. Has to be set.
storage string The id of the storage component to save the form data to.
autosave boolean Automatically save data on change events, instead of just on submit events.

Methods

Method Parameters Returns Description
loadFormData() - - Load the data from the storage component.
saveFormData() - - Save the data from the storage component.

Development

Brick components use Stylus to generate their CSS.

This repository comes outfitted with a set of tools to ease the development process.

To get started:

While developing your component, there is a development server that will watch your files for changes and automatically re-build your styles and re-lint your code.

To run the development server:

To simply build and lint your code, run gulp build.

You can also push your code to GitHub Pages by running gulp deploy.