Install via NPM.
npm install rocket-form
Note that this module has a dependency Rocket Tools (28kb) which will automatically be installed as well.
Start by including the necessary files.
<head> <link href="node_modules/rocket-form/css/form.min.css" rel="stylesheet" type="text/css"> </head> <body> /* Your content goes here */ <script src="node_modules/rocket-tools/js/tools.min.js"></script> <script src="node_modules/rocket-form/js/form.min.js"></script> </body>
<div class="mod-form"> <label for="text-1">Form Label</label> <input type="text" id="text-1"> </div> <div class="mod-form-alt"> <label for="text-2">Form Label</label> <input type="text" id="text-2"> </div> <script> // Default target property is ".mod-form". Rocket.form({ colour: 'red', style: 'raised' }); // With Shifting Label Rocket.form({ target: '.mod-form-alt', colour: 'red', label: 'shift', style: 'raised' }); </script>
For a more detailed look into the available options, you can read the documentation at https://github.com/chrishumboldt/Rocket-Form