Using Shield UI Lite with Bower

Bower is a package manager for the web. It is a handy command line utility for managing external component dependencies containing HTML, JavaScript, CSS, font, image and other types of files. When used in a project, Bower takes care of fetching and installing the required packages, along with their dependencies, behind the scenes, which makes it ideal for front-end projects.

In this article we describe how you can use Bower to install the Shield UI Lite library, an open-sourced lightweight version of the Shield UI for JavaScript framework.

In order to use Bower, it must be installed on your computer. As mentioned in the instructions, NodeJS, NPM and Git should also be installed as they are required.

Next, create a new folder, navigate to it in the command line and execute:

bower install shieldui-lite

This should install the shieldui-lite package, which contains all the JavaScript and CSS files included in the Shield UI Lite library. Since the package depends on two other libraries - jQuery and Globalize, Bower installed them too. The install process resulted in creating the following directories, each one containing the different component assets:

You can start using the Shield UI Lite library immediately, as illustrated with the following file, located in your main project directory:

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8" />
    <title>Shield UI Lite Example</title>
    <link id="themecss" rel="stylesheet" type="text/css" href="bower_components/shieldui-lite/dist/css/light/all.min.css" />
    <script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="bower_components/shieldui-lite/dist/js/shieldui-lite-all.min.js"></script>
    <input type="text" id="date" name="date" />
    <script type="text/javascript">
        jQuery(function($) {

If you open the above example in your web browser, you should see the Shield UI DatePicker widget in action.

From this moment on, you can use any component included in the Shield UI Lite framework in your own project.