Ember Bootstrap is set of UI elements styled using Twitter Bootstrap (currently version 2) toolkit to use with Ember.js. The ultimate goal is to provide all elements from the Bootstrap toolkit.
- Buttons - Bootstrap.Button
- Modal panes - Bootstrap.ModalPane
- Nav lists - Bootstrap.NavList
- Pills - Bootstrap.Pills
- Tabs (header) - Bootstrap.Tabs
- Alert messages - Bootstrap.AlertMessage
- Block alert messages - Bootstrap.BlockAlertMessage
- Progress bars - Bootstrap.ProgressBar
- Badges - Bootstrap.Badge
- Labels - Bootstrap.Label
- Wells - Bootstrap.Well
- Badges - Bootstrap.Badge
- Labels - Bootstrap.Label
- Wells - Bootstrap.Well
- Text Field - Bootstrap.Forms.TextField
- Text Area - Bootstrap.Forms.TextArea
- Select - Bootstrap.Forms.Select
Button class automatically provides necessary classes (.btn
) and binds type
property to class (for example .btn-info
for info type) and if button
is disabled disabled
class.
<script type="text/x-handlebars">
{{view Bootstrap.Button type=info disabled=true}}Hello{{/view}}
</script>
Bootstrap.ModalPane.popup({
heading: "Sample modal pane",
message: "Sample message...",
primary: "OK",
secondary: "Cancel",
showBackdrop: true,
callback: function(opts, event) {
if (opts.primary) {
// primary button was pressed
} else if (opts.secondary) {
// secondary button was pressed
} else {
// close was pressed
}
}
});
<script type="text/x-handlebars">
{{view Bootstrap.NavList
contentBinding="SampleApp.navController.content"
selectionBinding="SampleApp.navController.selection"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Tabs
contentBinding="SampleApp.tabsController.content"
selectionBinding="SampleApp.tabsController.selection"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Pills
contentBinding="SampleApp.pillsController.content"
selectionBinding="SampleApp.pillsController.selection"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.AlertMessage type="success" message="You did it!"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.ProgressBar isStriped=true isAnimated=true
progressBinding="SampleApp.progressController.progress"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Label type="important" content="Important"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Badge type="success" contentBinding="SampleApp.TodoController.completed"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Well content="Important note about Ember and Bootstrap" }}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Breadcrumbs contentBinding="SampleApp.breadcrumbsController.content" }}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Pager contentBinding="SampleApp.pagerController.content" }}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Pagination contentBinding="SampleApp.paginationController.content" selectionBinding="SampleApp.paginationController.selection" }}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Forms.TextField valueBinding="myObject.content" label="content"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Forms.TextArea valueBinding="myObject.content" label="content"}}
</script>
<script type="text/x-handlebars">
{{view Bootstrap.Forms.Select contentBinding="content" valueBinding="selected" label="content"}}
</script>
To run unit tests, run bundle exec rackup
from the root directory and visit
http://localhost:9292/tests/index.html?package=ember-bootstrap
.
MIT License. Copyright 2012 Jiri Zajpt, Damien Mathieu, Franck Verrot
- Jiri Zajpt [email protected]
- Damien Mathieu [email protected]
- Franck Verrot [email protected]