A Javascript library to create Bootstrap components without HTML.
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.
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"
:
<button id="button-primary"></button>
Yuri.ui({
view: "button",
el: "#button-primary",
type: "primary",
text: "Primary",
icon: "star"
});
<button id="button-primary" class="btn btn-primary">
<span class="text">Primary </span>
<span class="glyphicon glyphicon-star"></span>
</button>