info@54: ---
info@54: layout: default
info@54: title: Components
info@54: slug: components
info@54: lead: "Over a dozen reusable components built to provide iconography, dropdowns, navigation, alerts, popovers, and much more."
info@54: base_url: "../"
info@54: ---
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
Glyphicons
info@54:
info@54:
info@54:
Available glyphs
info@54:
Includes 200 glyphs in font format from the Glyphicon Halflings set. Glyphicons Halflings are normally not available for free, but their creator has made them available for Bootstrap free of cost. As a thank you, we only ask that you to include a link back to Glyphicons whenever possible.
For performance reasons, all icons require a base class and individual icon class. To use, place the following code just about anywhere. Be sure to leave a space between the icon and text for proper padding.
info@54:
info@54:
Don't mix with other components
info@54:
Icon classes cannot be combined with other elements. They are designed to be standalone elements.
Group a series of buttons together on a single line with the button group. Add on optional JavaScript radio and checkbox style behavior with our buttons plugin.
info@54:
info@54:
info@54:
Tooltips & popovers in button groups require special setting
info@54:
When using tooltips or popovers on elements within a .btn-group, you'll have to specify the option container: 'body' to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).
info@54:
info@54:
info@54:
Basic example
info@54:
Wrap a series of buttons with .btn in .btn-group.
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54:
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Button toolbar
info@54:
Combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex components.
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
...
info@54:
...
info@54:
...
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Sizing
info@54:
Instead of applying button sizing classes to every button in a group, just add .btn-group-* to the .btn-group.
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
...
info@54:
...
info@54:
...
info@54:
...
info@54: {% endhighlight %}
info@54:
info@54:
Nesting
info@54:
Place a .btn-group within another .btn-group when you want dropdown menus mixed with a series of buttons.
Extend form controls by adding text or buttons before, after, or on both sides of any text-based input. Use .input-group with an .input-group-addon to prepend or append elements to a .form-control.
info@54:
info@54:
info@54:
Cross-browser compatibility
info@54:
Avoid using <select> elements here as they cannot be fully styled in WebKit browsers.
info@54:
info@54:
info@54:
Tooltips & popovers in input groups require special setting
info@54:
When using tooltips or popovers on elements within an .input-group, you'll have to specify the option container: 'body' to avoid unwanted side effects (such as the element growing wider and/or losing its rounded corners when the tooltip or popover is triggered).
info@54:
info@54:
info@54:
Don't mix with form groups
info@54:
Do not apply input group classes directly to form groups. An input group is an isolated component.
Add the relative form sizing classes to the .input-group itself and contents within will automatically resize—no need for repeating the form control size classes on each element.
Buttons in input groups are a bit different and require one extra level of nesting. Instead of .input-group-addon, you'll need to use .input-group-btn to wrap the buttons. This is required due to default browser styles that cannot be overridden.
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Buttons with dropdowns
info@54:
info@54:
info@54: {% highlight html %}
info@54:
Navs available in Bootstrap have shared markup, starting with the base .nav class, as well as shared states. Swap modifier classes to switch between each style.
info@54:
info@54:
Tabs
info@54:
Note the .nav-tabs class requires the .nav base class.
Easily make tabs or pills equal widths of their parent at screens wider than 768px with .nav-justified. On smaller screens, the nav links are stacked.
info@54:
info@54:
Safari and responsive justified navs
info@54:
Safari exhibits a bug in which resizing your browser horizontally causes rendering errors in the justified nav that are cleared upon refreshing. This bug is also shown in the justified nav example.
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.
info@54:
info@54:
info@54:
Customize the collapsing point
info@54:
Depending on the content in your navbar, you might need to change the point at which your navbar switches between collapsed and horizontal mode. Customize the @grid-float-breakpoint variable or add your own media query.
info@54:
info@54:
info@54:
Requires JavaScript
info@54:
If JavaScript is disabled and the viewport is narrow enough that the navbar collapses, it will be impossible to expand the navbar and view the content within the .navbar-collapse.
The responsive navbar requires the collapse plugin to be included in your version of Bootstrap.
info@54:
info@54:
info@54:
info@54:
Make navbars accessible
info@54:
Be sure to add a role="navigation" to every navbar to help with accessibility.
info@54:
info@54:
info@54:
info@54:
Forms
info@54:
Place form content within .navbar-form for proper vertical alignment and collapsed behavior in narrow viewports. Use the alignment options to decide where it resides within the navbar content.
info@54:
As a heads up, .navbar-form shares much of its code with .form-inline via mixin.
Screen readers will have trouble with your forms if you don't include a label for every input. For these inline navbar forms, you can hide the labels using the .sr-only class.
info@54:
info@54:
info@54:
info@54:
Buttons
info@54:
Add the .navbar-btn class to <button> elements not residing in a <form> to vertically center them in the navbar.
Like the standard button classes, .navbar-btn can be used on <a> and <input> elements. However, neither .navbar-btn nor the standard button classes should be used on <a> elements within .navbar-nav.
info@54:
info@54:
info@54:
Text
info@54:
Wrap strings of text in an element with .navbar-text, usually on a <p> tag for proper leading and color.
For folks using standard links that are not within the regular navbar navigation component, use the .navbar-link class to add the proper colors for the default and inverse navbar options.
Align nav links, forms, buttons, or text, using the .navbar-left or .navbar-right utility classes. Both classes will add a CSS float in the specified direction. For example, to align nav links, put them in a separate <ul> with the respective utility class applied.
info@54:
These classes are mixin-ed versions of .pull-left and .pull-right, but they're scoped to media queries for easier handling of navbar components across device sizes.
The fixed navbar will overlay your other content, unless you add padding to the top of the <body>. Try out your own values or use our snippet below. Tip: By default, the navbar is 50px high.
The fixed navbar will overlay your other content, unless you add padding to the bottom of the <body>. Try out your own values or use our snippet below. Tip: By default, the navbar is 50px high.
Make sure to include this after the core Bootstrap CSS.
info@54:
info@54:
info@54:
info@54:
Static top
info@54:
Create a full-width navbar that scrolls away with the page by adding .navbar-static-top. Unlike the .navbar-fixed-* classes, you do not need to change any padding on the body.
Provide pagination links for your site or app with the multi-page pagination component, or the simpler pager alternative.
info@54:
info@54:
Default pagination
info@54:
Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.
To make the jumbotron full width, and without rounded corners, place it outside all .containers and instead add a .container within.
info@54: {% highlight html %}
info@54:
info@54:
info@54: ...
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
Page header
info@54:
info@54:
A simple shell for an h1 to appropriately space out and segment sections of content on a page. It can utilize the h1's default small element, as well as most other components (with additional styles).
info@54:
info@54:
info@54:
Example page header Subtext for header
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
Example page header Subtext for header
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
Thumbnails
info@54:
info@54:
Extend Bootstrap's grid system with the thumbnail component to easily display grids of images, videos, text, and more.
info@54:
info@54:
Default example
info@54:
By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.
With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
Thumbnail label
info@54:
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. For inline dismissal, use the alerts jQuery plugin.
info@54:
info@54:
Examples
info@54:
Wrap any text and an optional dismiss button in .alert and one of the four contextual classes (e.g., .alert-success) for basic alert messages.
info@54:
info@54:
info@54:
No default class
info@54:
Alerts don't have default classes, only base and modifier classes. A default gray alert doesn't make too much sense, so you're required to specify a type via contextual class. Choose from success, info, warning, or danger.
info@54:
info@54:
info@54:
info@54:
info@54: Well done! You successfully read this important alert message.
info@54:
info@54:
info@54: Heads up! This alert needs your attention, but it's not super important.
info@54:
info@54:
info@54: Warning! Best check yo self, you're not looking too good.
info@54:
info@54:
info@54: Oh snap! Change a few things up and try submitting again.
info@54:
info@54:
info@54: {% highlight html %}
info@54:
...
info@54:
...
info@54:
...
info@54:
...
info@54: {% endhighlight %}
info@54:
info@54:
Dismissable alerts
info@54:
Build on any alert by adding an optional .alert-dismissable and close button.
info@54:
info@54:
info@54:
info@54: Warning! Best check yo self, you're not looking too good.
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54: Warning! Best check yo self, you're not looking too good.
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
info@54:
Ensure proper behavior across all devices
info@54:
Be sure to use the <button> element with the data-dismiss="alert" data attribute.
info@54:
info@54:
info@54:
Links in alerts
info@54:
Use the .alert-link utility class to quickly provide matching colored links within any alert.
Provide up-to-date feedback on the progress of a workflow or action with simple yet flexible progress bars.
info@54:
info@54:
info@54:
Cross-browser compatibility
info@54:
Progress bars use CSS3 transitions and animations to achieve some of their effects. These features are not supported in Internet Explorer 9 and below or older versions of Firefox. Opera 12 does not support animations.
info@54:
info@54:
info@54:
Basic example
info@54:
Default progress bar.
info@54:
info@54:
info@54:
info@54: 60% Complete
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54: 60% Complete
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Contextual alternatives
info@54:
Progress bars use some of the same button and alert classes for consistent styles.
info@54:
info@54:
info@54:
info@54: 40% Complete (success)
info@54:
info@54:
info@54:
info@54:
info@54: 20% Complete
info@54:
info@54:
info@54:
info@54:
info@54: 60% Complete (warning)
info@54:
info@54:
info@54:
info@54:
info@54: 80% Complete (danger)
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54: 40% Complete (success)
info@54:
info@54:
info@54:
info@54:
info@54: 20% Complete
info@54:
info@54:
info@54:
info@54:
info@54: 60% Complete (warning)
info@54:
info@54:
info@54:
info@54:
info@54: 80% Complete
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Striped
info@54:
Uses a gradient to create a striped effect. Not available in IE8.
info@54:
info@54:
info@54:
info@54: 40% Complete (success)
info@54:
info@54:
info@54:
info@54:
info@54: 20% Complete
info@54:
info@54:
info@54:
info@54:
info@54: 60% Complete (warning)
info@54:
info@54:
info@54:
info@54:
info@54: 80% Complete (danger)
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54: 40% Complete (success)
info@54:
info@54:
info@54:
info@54:
info@54: 20% Complete
info@54:
info@54:
info@54:
info@54:
info@54: 60% Complete (warning)
info@54:
info@54:
info@54:
info@54:
info@54: 80% Complete (danger)
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Animated
info@54:
Add .active to .progress-striped to animate the stripes right to left. Not available in all versions of IE.
info@54:
info@54:
info@54:
45% Complete
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54: 45% Complete
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Stacked
info@54:
Place multiple bars into the same .progress to stack them.
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.
info@54:
info@54:
Default media
info@54:
The default media allow to float a media object (images, video, audio) to the left or right of a content block.
info@54: 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.
info@54:
info@54: 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.
info@54:
info@54: 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.
info@54:
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.
info@54: 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.
info@54:
info@54:
info@54: 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.
info@54:
info@54: 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.
info@54:
info@54: 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.
info@54:
List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.
info@54:
info@54:
Basic example
info@54:
The most basic list group is simply an unordered list with list items, and the proper classes. Build upon it with the options that follow, or your own CSS as needed.
info@54:
info@54:
info@54:
Cras justo odio
info@54:
Dapibus ac facilisis in
info@54:
Morbi leo risus
info@54:
Porta ac consectetur ac
info@54:
Vestibulum at eros
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
Cras justo odio
info@54:
Dapibus ac facilisis in
info@54:
Morbi leo risus
info@54:
Porta ac consectetur ac
info@54:
Vestibulum at eros
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Badges
info@54:
Add the badges component to any list group item and it will automatically be positioned on the right.
info@54:
info@54:
info@54:
info@54: 14
info@54: Cras justo odio
info@54:
info@54:
info@54: 2
info@54: Dapibus ac facilisis in
info@54:
info@54:
info@54: 1
info@54: Morbi leo risus
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54: 14
info@54: Cras justo odio
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Linked items
info@54:
Linkify list group items by using anchor tags instead of list items (that also means a parent <div> instead of an <ul>). No need for individual parents around each element.
While not always necessary, sometimes you need to put your DOM in a box. For those situations, try the panel component.
info@54:
info@54:
Basic example
info@54:
By default, all the .panel does is apply some basic border and padding to contain some content.
info@54:
info@54:
info@54:
info@54: Basic panel example
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54: Basic panel example
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Panel with heading
info@54:
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.
info@54:
info@54:
info@54:
Panel heading without title
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54:
info@54:
Panel title
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
Panel heading without title
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
Panel title
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Panel with footer
info@54:
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.
info@54:
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
Contextual alternatives
info@54:
Like other components, easily make a panel more meaningful to a particular context by adding any of the contextual state classes.
info@54:
info@54:
info@54:
info@54:
Panel title
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54:
info@54:
Panel title
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54:
info@54:
Panel title
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54:
info@54:
Panel title
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54:
info@54:
Panel title
info@54:
info@54:
info@54: Panel content
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
...
info@54:
...
info@54:
...
info@54:
...
info@54:
...
info@54: {% endhighlight %}
info@54:
info@54:
With tables
info@54:
Add any non-bordered .table within a panel for a seamless design. If there is a .panel-body, we add an extra border to the top of the table for separation.
info@54:
info@54:
info@54:
info@54:
Panel heading
info@54:
info@54:
Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
info@54:
#
info@54:
First Name
info@54:
Last Name
info@54:
Username
info@54:
info@54:
info@54:
info@54:
info@54:
1
info@54:
Mark
info@54:
Otto
info@54:
@mdo
info@54:
info@54:
info@54:
2
info@54:
Jacob
info@54:
Thornton
info@54:
@fat
info@54:
info@54:
info@54:
3
info@54:
Larry
info@54:
the Bird
info@54:
@twitter
info@54:
info@54:
info@54:
info@54:
info@54:
info@54: {% highlight html %}
info@54:
info@54:
info@54:
Panel heading
info@54:
info@54:
...
info@54:
info@54:
info@54:
info@54:
info@54: ...
info@54:
info@54:
info@54: {% endhighlight %}
info@54:
info@54:
If there is no panel body, the component moves from panel header to table without interruption.
Easily include full-width list groups within any panel.
info@54:
info@54:
info@54:
info@54:
Panel heading
info@54:
info@54:
Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.