Components
Over a dozen reusable components built to provide iconography, dropdowns, input groups, navigation, alerts, and much more.
components-dropdown Dropdown
Wrap the dropdown's trigger and the dropdown menu within .dropdown
, or another element that declares position: relative;
. Then add the menu's HTML.
<div class="dropdown"> <a id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="/page.html"> Dropdown <span class="caret"></span> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1"> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li> <li role="presentation" class="divider"></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li> </ul> </div>
components-btn-group Buttons group
Group of buttons
<div class="btn-group [modifier class]"> <button type="button" class="btn btn-default">Left</button> <button type="button" class="btn btn-default">Middle</button> <button type="button" class="btn btn-default">Right</button> </div>
Large .btn-group-lg
Small .btn-group-sm
Extra small .btn-group-xs
components-nav Navs
Navbars are responsive meta components that serve as navigation headers for your application or site. They begin collapsed (and are toggleable) in mobile views and become horizontal as the available viewport width increases.
<ul class="nav [modifier class]" role="tablist"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Profile</a></li> <li><a href="#">Messages</a></li> </ul>
Simple navigation .nav-tabs
Pill navigation .nav-pills
Stacked navigation .nav-tabs.nav-stacked
Pill and stacked navigation .nav-pills.nav-stacked
Justified navigation .nav-tabs.nav-justified
Pill and justified navigation .nav-pills.nav-justified
components-breadcrumb Breadcrumbs
Indicate the current page's location within a navigational hierarchy.
<ol class="breadcrumb"> <li><a href="#">Home</a></li> <li><a href="#">Library</a></li> <li class="active">Data</li> </ol>
components-pagination Pagination
Provide pagination links for your site or app with the multi-page pagination component, or the simpler pager alternative.
<ul class="pagination [modifier class]"> <li><a href="#">«</a></li> <li><a href="#">Previous</a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#">Next</a></li> <li><a href="#">»</a></li> </ul>
Large .pagination-lg
Small .pagination-sm
components-label Labels
Add any of the below mentioned modifier classes to change the appearance of a label.
Example heading New
<h5>Example heading <span class="label [modifier class]">New</span></h5>
Default .label-default
Example heading New
Primary .label-primary
Example heading New
Success .label-success
Example heading New
Info .label-info
Example heading New
Warning .label-warning
Example heading New
Danger .label-danger
Example heading New
components-badge Badges
Easily highlight new or unread items by adding a <span class="badge">
to links, Bootstrap navs, and more.
<a href="#">Inbox <span class="badge">42</span></a>
components-jumbotron Jumbotron
A lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.
Hello, world!
This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.
<div class="jumbotron"> <div class="container"> <h1>Hello, world!</h1> <p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p> <p><a class="btn btn-primary btn-lg" role="button">Learn more</a></p> </div> </div>
components-alert Alerts
A lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.
<div class="alert [modifier class]">Well done! You successfully read this important alert message.</div> <div class="alert [modifier class] alert-dismissable">Well done! You successfully read this important alert message.<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>
Success .alert-success
Information .alert-info
Warning .alert-warning
Danger .alert-danger
components-progress Progress bars
Provide up-to-date feedback on the progress of a workflow or action with simple yet flexible progress bars.
<div class="progress"> <div class="progress-bar [modifier class]" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"> <span class="sr-only">60% Complete</span> </div> </div>
Success .progress-bar-success
Information .progress-bar-info
Warning .progress-bar-warning
Danger .progress-bar-danger
components-progress-label With label
Remove the <span>
with .sr-only
class from within the progress bar to show a visible percentage.
<div class="progress"> <div class="progress-bar " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%;"> 60% </div> </div>
components-progress-width With min-width
To ensure that the label text remains legible even for low percentages, consider adding a min-width
to the progress bar.
<div class="progress"> <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="min-width: 2em;"> 0% </div> </div> <div class="progress"> <div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="min-width: 2em; width: 2%;"> 2% </div> </div>
components-progress-striped Striped
Use .progress-bar-striped
to add a gradient to create a striped effect. Not available in IE9 and below.
<div class="progress"> <div class="progress-bar progress-bar-success progress-bar-striped [modifier class]" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> <span class="sr-only">40% Complete (success)</span> </div> </div> <div class="progress"> <div class="progress-bar progress-bar-info progress-bar-striped [modifier class]" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"> <span class="sr-only">20% Complete</span> </div> </div> <div class="progress"> <div class="progress-bar progress-bar-warning progress-bar-striped [modifier class]" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> <span class="sr-only">60% Complete (warning)</span> </div> </div> <div class="progress"> <div class="progress-bar progress-bar-danger progress-bar-striped [modifier class]" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> <span class="sr-only">80% Complete (danger)</span> </div> </div>
Animate by adding .active
to .progress-bar-striped
. .active
components-progress-stacked Stacked
Place multiple bars into the same .progress
to stack them.
<div class="progress"> <div class="progress-bar progress-bar-success" style="width: 35%"> <span class="sr-only">35% Complete (success)</span> </div> <div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%"> <span class="sr-only">20% Complete (warning)</span> </div> <div class="progress-bar progress-bar-danger" style="width: 10%"> <span class="sr-only">10% Complete (danger)</span> </div> </div>
components-media Media objects
Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.
<div class="media"> <a class="pull-left" href="#"> <img class="media-object" src="http://placehold.it/140x140" alt="..."> </a> <div class="media-body"> <h4 class="media-heading">Media heading</h4> Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. </div> </div>
components-list-group List group
List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.
- Cras justo odio
- Dapibus ac facilisis in
- Morbi leo risus
- Porta ac consectetur ac
- Vestibulum at eros
<ul class="list-group"> <li class="list-group-item">Cras justo odio</li> <li class="list-group-item">Dapibus ac facilisis in</li> <li class="list-group-item">Morbi leo risus</li> <li class="list-group-item">Porta ac consectetur ac</li> <li class="list-group-item">Vestibulum at eros</li> </ul>
components-list-group-badges Badges
Add the badges component to any list group item and it will automatically be positioned on the right.
- 14Cras justo odio
- 2Dapibus ac facilisis in
- 1Morbi leo risus
<ul class="list-group"> <li class="list-group-item"><span class="badge">14</span>Cras justo odio</li> <li class="list-group-item"><span class="badge">2</span>Dapibus ac facilisis in</li> <li class="list-group-item"><span class="badge">1</span>Morbi leo risus</li> </ul>
components-panel Panels
While not always necessary, sometimes you need to put your DOM in a box. For those situations, try the panel component.
components-panel-basic Basic example
By default, all the .panel
does is apply some basic border and padding to contain some content.
<div class="panel panel-default"> <div class="panel-body"> Basic panel example </div> </div>
components-panel-heading Panel with heading
Easily add a heading container to your panel with .panel-heading
. You may also include any >h1<->h6< with a .panel-title
class to add a pre-styled heading.
For proper link coloring, be sure to place links in headings within .panel-title
.
Panel title
<div class="panel panel-default"> <div class="panel-heading">Panel heading without title</div> <div class="panel-body"> Panel content </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> Panel content </div> </div>
components-panel-footer Panel with footer
Wrap buttons or secondary text in .panel-footer
. Note that panel footers do not inherit colors and borders when using contextual variations as they are not meant to be in the foreground.
<div class="panel panel-default"> <div class="panel-body"> Panel content </div> <div class="panel-footer">Panel footer</div> </div>
components-panel-contextual Contextual alternatives
Like other components, easily make a panel more meaningful to a particular context by adding any of the contextual state classes.
Panel title
<div class="panel [modifier class]"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> Panel content </div> </div>