sanchan / yuri-ui

A Javascript library to create Bootstrap components without HTML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yuri-ui

A Javascript library to create Bootstrap components without HTML.

Why?

Because in some moment I found interesting to create a tool for fast prototyping. I love Bootstrap and I though it could be a good idea just to create Bootstrap's components just with a single line on the DOM and configuring with JSON data from the Javascript file.

Components

Buttons

For buttons you can define the contextual type setting the type option. The valid type values are "default", "primary", "success", "info", "warning", "danger".

Also you can set an icon setting the icon option. You can use any prefix used by Glyphicon icons set. For example, if you want to use the glyphicon-star icon, the you just need to set icon: "star":

HTML

<button id="button-primary"></button>

Javascript

Yuri.ui({
  view: "button",
  el: "#button-primary",
  type: "primary",
  text: "Primary",
  icon: "star"
});

Result

<button id="button-primary" class="btn btn-primary">
    <span class="text">Primary  </span>
    <span class="glyphicon glyphicon-star"></span>
</button>

About

A Javascript library to create Bootstrap components without HTML

License:MIT License


Languages

Language:HTML 75.8%Language:CoffeeScript 14.8%Language:CSS 7.9%Language:JavaScript 1.5%