{{_i}}JavaScript{{/i}}

{{_i}}Bring Bootstrap's components to life—now with 13 custom jQuery plugins.{{/i}}

{{_i}}Individual or compiled{{/i}}

{{_i}}Plugins can be included individually (though some have required dependencies), or all at once. Both bootstrap.js and bootstrap.min.js contain all plugins in a single file.{{/i}}

{{_i}}Data attributes{{/i}}

{{_i}}You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.{{/i}}

{{_i}}That said, in some situations it may be desirable to turn this functionality off. Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:{{/i}}

$('body').off('.data-api')

{{_i}}Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:{{/i}}

$('body').off('.alert.data-api')

{{_i}}Programmatic API{{/i}}

{{_i}}We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon.{{/i}}

$(".btn.danger").button("toggle").addClass("fat")

{{_i}}All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):{{/i}}

$("#myModal").modal()                       // initialized with defaults
$("#myModal").modal({ keyboard: false })   // initialized with no keyboard
$("#myModal").modal('show')                // initializes and invokes show immediately

{{_i}}Each plugin also exposes its raw constructor on a `Constructor` property: $.fn.popover.Constructor. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover').{{/i}}

{{_i}}No Conflict{{/i}}

{{_i}}Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call .noConflict on the plugin you wish to revert the value of.{{/i}}

var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
$.fn.bootstrapBtn = bootstrapButton            // give $().bootstrapBtn the bootstrap functionality

{{_i}}Events{{/i}}

{{_i}}Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. show) is triggered at the start of an event, and its past participle form (ex. shown) is trigger on the completion of an action.{{/i}}

{{_i}}All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.{{/i}}

$('#myModal').on('show', function (e) {
    if (!data) return e.preventDefault() // stops modal from being shown
})

{{_i}}About transitions{{/i}}

{{_i}}For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.{{/i}}

{{_i}}Use cases{{/i}}

{{_i}}A few examples of the transition plugin:{{/i}}

  • {{_i}}Sliding or fading in modals{{/i}}
  • {{_i}}Fading out tabs{{/i}}
  • {{_i}}Fading out alerts{{/i}}
  • {{_i}}Sliding carousel panes{{/i}}
{{! Ideas: include docs for .fade.in, .slide.in, etc }}

{{_i}}Examples{{/i}}

{{_i}}Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.{{/i}}

{{_i}}Static example{{/i}}

{{_i}}A rendered modal with header, body, and set of actions in the footer.{{/i}}

{{! /example }}
<div class="modal hide fade">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h3>{{_i}}Modal header{{/i}}</h3>
  </div>
  <div class="modal-body">
    <p>{{_i}}One fine body…{{/i}}</p>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn">{{_i}}Close{{/i}}</a>
    <a href="#" class="btn btn-primary">{{_i}}Save changes{{/i}}</a>
  </div>
</div>

{{_i}}Live demo{{/i}}

{{_i}}Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page.{{/i}}

{{! /example }}
<!-- Button to trigger modal -->
<a href="#myModal" role="button" class="btn" data-toggle="modal">{{_i}}Launch demo modal{{/i}}</a>

<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Modal header</h3>
  </div>
  <div class="modal-body">
    <p>{{_i}}One fine body…{{/i}}</p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">{{_i}}Close{{/i}}</button>
    <button class="btn btn-primary">{{_i}}Save changes{{/i}}</button>
  </div>
</div>

{{_i}}Usage{{/i}}

{{_i}}Via data attributes{{/i}}

{{_i}}Activate a modal without writing JavaScript. Set data-toggle="modal" on a controller element, like a button, along with a data-target="#foo" or href="#foo" to target a specific modal to toggle.{{/i}}

<button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>

{{_i}}Via JavaScript{{/i}}

{{_i}}Call a modal with id myModal with a single line of JavaScript:{{/i}}

$('#myModal').modal(options)

{{_i}}Options{{/i}}

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-backdrop="".{{/i}}

{{_i}}Name{{/i}} {{_i}}type{{/i}} {{_i}}default{{/i}} {{_i}}description{{/i}}
{{_i}}backdrop{{/i}} {{_i}}boolean{{/i}} {{_i}}true{{/i}} {{_i}}Includes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click.{{/i}}
{{_i}}keyboard{{/i}} {{_i}}boolean{{/i}} {{_i}}true{{/i}} {{_i}}Closes the modal when escape key is pressed{{/i}}
{{_i}}show{{/i}} {{_i}}boolean{{/i}} {{_i}}true{{/i}} {{_i}}Shows the modal when initialized.{{/i}}
{{_i}}remote{{/i}} {{_i}}path{{/i}} {{_i}}false{{/i}}

{{_i}}If a remote url is provided, content will be loaded via jQuery's load method and injected into the .modal-body. If you're using the data api, you may alternatively use the href tag to specify the remote source. An example of this is shown below:{{/i}}

<a data-toggle="modal" href="remote.html" data-target="#modal">click me</a>
Methods{{/i}}

.modal({{_i}}options{{/i}})

{{_i}}Activates your content as a modal. Accepts an optional options object.{{/i}}

$('#myModal').modal({
  keyboard: false
})

.modal('toggle')

{{_i}}Manually toggles a modal.{{/i}}

$('#myModal').modal('toggle')

.modal('show')

{{_i}}Manually opens a modal.{{/i}}

$('#myModal').modal('show')

.modal('hide')

{{_i}}Manually hides a modal.{{/i}}

$('#myModal').modal('hide')

{{_i}}Events{{/i}}

{{_i}}Bootstrap's modal class exposes a few events for hooking into modal functionality.{{/i}}

{{_i}}Event{{/i}} {{_i}}Description{{/i}}
{{_i}}show{{/i}} {{_i}}This event fires immediately when the show instance method is called.{{/i}}
{{_i}}shown{{/i}} {{_i}}This event is fired when the modal has been made visible to the user (will wait for css transitions to complete).{{/i}}
{{_i}}hide{{/i}} {{_i}}This event is fired immediately when the hide instance method has been called.{{/i}}
{{_i}}hidden{{/i}} {{_i}}This event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).{{/i}}
$('#myModal').on('hidden', function () {
  // {{_i}}do something…{{/i}}
})

{{_i}}Example in navbar{{/i}}

{{_i}}The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.{{/i}}

@fat

Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

@mdo

Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.

one

Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.

two

In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.

three

Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.

{{! /example }}

{{_i}}Usage{{/i}}

{{_i}}Via data attributes{{/i}}

{{_i}}To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body) and data-target=".navbar" to select which nav to use. You'll want to use scrollspy with a .nav component.{{/i}}

<body data-spy="scroll" data-target=".navbar">...</body>

{{_i}}Via JavaScript{{/i}}

{{_i}}Call the scrollspy via JavaScript:{{/i}}

$('#navbar').scrollspy()
{{_i}}Heads up!{{/i}} {{_i}}Navbar links must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>.{{/i}}

{{_i}}Methods{{/i}}

.scrollspy('refresh')

{{_i}}When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:{{/i}}

$('[data-spy="scroll"]').each(function () {
  var $spy = $(this).scrollspy('refresh')
});

{{_i}}Options{{/i}}

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset="".{{/i}}

{{_i}}Name{{/i}} {{_i}}type{{/i}} {{_i}}default{{/i}} {{_i}}description{{/i}}
{{_i}}offset{{/i}} {{_i}}number{{/i}} {{_i}}10{{/i}} {{_i}}Pixels to offset from top when calculating position of scroll.{{/i}}

{{_i}}Events{{/i}}

{{_i}}Event{{/i}} {{_i}}Description{{/i}}
{{_i}}activate{{/i}} {{_i}}This event fires whenever a new item becomes activated by the scrollspy.{{/i}}

{{_i}}Example tabs{{/i}}

{{_i}}Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.{{/i}}

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

{{! /example }}

{{_i}}Usage{{/i}}

{{_i}}Enable tabbable tabs via JavaScript (each tab needs to be activated individually):{{/i}}

$('#myTab a').click(function (e) {
  e.preventDefault();
  $(this).tab('show');
})

{{_i}}You can activate individual tabs in several ways:{{/i}}

$('#myTab a[href="#profile"]').tab('show'); // Select tab by name
$('#myTab a:first').tab('show'); // Select first tab
$('#myTab a:last').tab('show'); // Select last tab
$('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)

{{_i}}Markup{{/i}}

{{_i}}You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the Bootstrap tab styling.{{/i}}

<ul class="nav nav-tabs">
  <li><a href="#home" data-toggle="tab">{{_i}}Home{{/i}}</a></li>
  <li><a href="#profile" data-toggle="tab">{{_i}}Profile{{/i}}</a></li>
  <li><a href="#messages" data-toggle="tab">{{_i}}Messages{{/i}}</a></li>
  <li><a href="#settings" data-toggle="tab">{{_i}}Settings{{/i}}</a></li>
</ul>

{{_i}}Methods{{/i}}

$().tab

{{_i}}Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM.{{/i}}

<ul class="nav nav-tabs" id="myTab">
  <li class="active"><a href="#home">{{_i}}Home{{/i}}</a></li>
  <li><a href="#profile">{{_i}}Profile{{/i}}</a></li>
  <li><a href="#messages">{{_i}}Messages{{/i}}</a></li>
  <li><a href="#settings">{{_i}}Settings{{/i}}</a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="home">...</div>
  <div class="tab-pane" id="profile">...</div>
  <div class="tab-pane" id="messages">...</div>
  <div class="tab-pane" id="settings">...</div>
</div>

<script>
  $(function () {
    $('#myTab a:last').tab('show');
  })
</script>

{{_i}}Events{{/i}}

{{_i}}Event{{/i}} {{_i}}Description{{/i}}
{{_i}}show{{/i}} {{_i}}This event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.{{/i}}
{{_i}}shown{{/i}} {{_i}}This event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.{{/i}}
$('a[data-toggle="tab"]').on('shown', function (e) {
  e.target // activated tab
  e.relatedTarget // previous tab
})

{{_i}}Examples{{/i}}

{{_i}}Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.{{/i}}

{{_i}}For performance reasons, the tooltip and popover data-apis are opt in, meaning you must initialize them yourself.{{/i}}

{{_i}}Hover over the links below to see tooltips:{{/i}}

{{_i}}Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.{{/i}}

{{! /example }}

{{_i}}Four directions{{/i}}

{{! /example }}

{{_i}}Usage{{/i}}

{{_i}}Trigger the tooltip via JavaScript:{{/i}}

$('#example').tooltip({{_i}}options{{/i}})

{{_i}}Options{{/i}}

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".{{/i}}

{{_i}}Name{{/i}} {{_i}}type{{/i}} {{_i}}default{{/i}} {{_i}}description{{/i}}
{{_i}}animation{{/i}} {{_i}}boolean{{/i}} true {{_i}}apply a css fade transition to the tooltip{{/i}}
{{_i}}html{{/i}} {{_i}}boolean{{/i}} false {{_i}}Insert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.{{/i}}
{{_i}}placement{{/i}} {{_i}}string | function{{/i}} 'top' {{_i}}how to position the tooltip{{/i}} - top | bottom | left | right
{{_i}}selector{{/i}} {{_i}}string{{/i}} false {{_i}}If a selector is provided, tooltip objects will be delegated to the specified targets.{{/i}}
{{_i}}title{{/i}} {{_i}}string | function{{/i}} '' {{_i}}default title value if `title` tag isn't present{{/i}}
{{_i}}trigger{{/i}} {{_i}}string{{/i}} 'hover focus' {{_i}}how tooltip is triggered{{/i}} - click | hover | focus | manual. {{_i}}Note you case pass trigger mutliple, space seperated, trigger types.{{/i}}
{{_i}}delay{{/i}} {{_i}}number | object{{/i}} 0

{{_i}}delay showing and hiding the tooltip (ms) - does not apply to manual trigger type{{/i}}

{{_i}}If a number is supplied, delay is applied to both hide/show{{/i}}

{{_i}}Object structure is: delay: { show: 500, hide: 100 }{{/i}}

{{_i}}container{{/i}} {{_i}}string | false{{/i}} {{_i}}false{{/i}}

{{_i}}Appends the tooltip to a specific element container: 'body'{{/i}}

{{_i}}Heads up!{{/i}} {{_i}}Options for individual tooltips can alternatively be specified through the use of data attributes.{{/i}}

{{_i}}Markup{{/i}}

<a href="#" data-toggle="tooltip" title="{{_i}}first tooltip{{/i}}">{{_i}}hover over me{{/i}}</a>

{{_i}}Methods{{/i}}

$().tooltip({{_i}}options{{/i}})

{{_i}}Attaches a tooltip handler to an element collection.{{/i}}

.tooltip('show')

{{_i}}Reveals an element's tooltip.{{/i}}

$('#element').tooltip('show')

.tooltip('hide')

{{_i}}Hides an element's tooltip.{{/i}}

$('#element').tooltip('hide')

.tooltip('toggle')

{{_i}}Toggles an element's tooltip.{{/i}}

$('#element').tooltip('toggle')

.tooltip('destroy')

{{_i}}Hides and destroys an element's tooltip.{{/i}}

$('#element').tooltip('destroy')

{{_i}}Examples{{/i}}

{{_i}}Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.{{/i}}

{{_i}}Static popover{{/i}}

{{_i}}Four options are available: top, right, bottom, and left aligned.{{/i}}

Popover top

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

Popover right

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

Popover bottom

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

Popover left

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

{{_i}}No markup shown as popovers are generated from JavaScript and content within a data attribute.{{/i}}

Live demo

{{_i}}Four directions{{/i}}

{{! /example }}

{{_i}}Usage{{/i}}

{{_i}}Enable popovers via JavaScript:{{/i}}

$('#example').popover({{_i}}options{{/i}})

{{_i}}Options{{/i}}

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".{{/i}}

{{_i}}Name{{/i}} {{_i}}type{{/i}} {{_i}}default{{/i}} {{_i}}description{{/i}}
{{_i}}animation{{/i}} {{_i}}boolean{{/i}} true {{_i}}apply a css fade transition to the tooltip{{/i}}
{{_i}}html{{/i}} {{_i}}boolean{{/i}} false {{_i}}Insert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.{{/i}}
{{_i}}placement{{/i}} {{_i}}string | function{{/i}} 'right' {{_i}}how to position the popover{{/i}} - top | bottom | left | right
{{_i}}selector{{/i}} {{_i}}string{{/i}} false {{_i}}if a selector is provided, tooltip objects will be delegated to the specified targets{{/i}}
{{_i}}trigger{{/i}} {{_i}}string{{/i}} 'click' {{_i}}how popover is triggered{{/i}} - click | hover | focus | manual
{{_i}}title{{/i}} {{_i}}string | function{{/i}} '' {{_i}}default title value if `title` attribute isn't present{{/i}}
{{_i}}content{{/i}} {{_i}}string | function{{/i}} '' {{_i}}default content value if `data-content` attribute isn't present{{/i}}
{{_i}}delay{{/i}} {{_i}}number | object{{/i}} 0

{{_i}}delay showing and hiding the popover (ms) - does not apply to manual trigger type{{/i}}

{{_i}}If a number is supplied, delay is applied to both hide/show{{/i}}

{{_i}}Object structure is: delay: { show: 500, hide: 100 }{{/i}}

{{_i}}container{{/i}} {{_i}}string | false{{/i}} {{_i}}false{{/i}}

{{_i}}Appends the popover to a specific element container: 'body'{{/i}}

{{_i}}Heads up!{{/i}} {{_i}}Options for individual popovers can alternatively be specified through the use of data attributes.{{/i}}

{{_i}}Markup{{/i}}

{{_i}}For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.{{/i}}

{{_i}}Methods{{/i}}

$().popover({{_i}}options{{/i}})

{{_i}}Initializes popovers for an element collection.{{/i}}

.popover('show')

{{_i}}Reveals an elements popover.{{/i}}

$('#element').popover('show')

.popover('hide')

{{_i}}Hides an elements popover.{{/i}}

$('#element').popover('hide')

.popover('toggle')

{{_i}}Toggles an elements popover.{{/i}}

$('#element').popover('toggle')

.popover('destroy')

{{_i}}Hides and destroys an element's popover.{{/i}}

$('#element').popover('destroy')

{{_i}}Example alerts{{/i}}

{{_i}}Add dismiss functionality to all alert messages with this plugin.{{/i}}

{{_i}}Holy guacamole!{{/i}} {{_i}}Best check yo self, you're not looking too good.{{/i}}
{{! /example }}

{{_i}}Oh snap! You got an error!{{/i}}

{{_i}}Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.{{/i}}

{{_i}}Take this action{{/i}} {{_i}}Or do this{{/i}}

{{! /example }}

{{_i}}Usage{{/i}}

{{_i}}Enable dismissal of an alert via JavaScript:{{/i}}

$(".alert").alert()

{{_i}}Markup{{/i}}

{{_i}}Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.{{/i}}

<a class="close" data-dismiss="alert" href="#">&times;</a>

{{_i}}Methods{{/i}}

$().alert()

{{_i}}Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.{{/i}}

.alert('close')

{{_i}}Closes an alert.{{/i}}

$(".alert").alert('close')

{{_i}}Events{{/i}}

{{_i}}Bootstrap's alert class exposes a few events for hooking into alert functionality.{{/i}}

{{_i}}Event{{/i}} {{_i}}Description{{/i}}
{{_i}}close{{/i}} {{_i}}This event fires immediately when the close instance method is called.{{/i}}
{{_i}}closed{{/i}} {{_i}}This event is fired when the alert has been closed (will wait for css transitions to complete).{{/i}}
$('#my-alert').bind('closed', function () {
  // {{_i}}do something…{{/i}}
})

{{_i}}Example uses{{/i}}

{{_i}}Do more with buttons. Control button states or create groups of buttons for more components like toolbars.{{/i}}

{{_i}}Stateful{{/i}}

{{_i}}Add data-loading-text="Loading..." to use a loading state on a button.{{/i}}

{{! /example }}
<button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>

{{_i}}Single toggle{{/i}}

{{_i}}Add data-toggle="button" to activate toggling on a single button.{{/i}}

{{! /example }}
<button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>

{{_i}}Checkbox{{/i}}

{{_i}}Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.{{/i}}

{{! /example }}
<div class="btn-group" data-toggle="buttons-checkbox">
  <button type="button" class="btn btn-primary">Left</button>
  <button type="button" class="btn btn-primary">Middle</button>
  <button type="button" class="btn btn-primary">Right</button>
</div>

{{_i}}Radio{{/i}}

{{_i}}Add data-toggle="buttons-radio" for radio style toggling on btn-group.{{/i}}

{{! /example }}
<div class="btn-group" data-toggle="buttons-radio">
  <button type="button" class="btn btn-primary">Left</button>
  <button type="button" class="btn btn-primary">Middle</button>
  <button type="button" class="btn btn-primary">Right</button>
</div>

{{_i}}Usage{{/i}}

{{_i}}Enable buttons via JavaScript:{{/i}}

$('.nav-tabs').button()

{{_i}}Markup{{/i}}

{{_i}}Data attributes are integral to the button plugin. Check out the example code below for the various markup types.{{/i}}

{{_i}}Options{{/i}}

{{_i}}None{{/i}}

{{_i}}Methods{{/i}}

$().button('toggle')

{{_i}}Toggles push state. Gives the button the appearance that it has been activated.{{/i}}

{{_i}}Heads up!{{/i}} {{_i}}You can enable auto toggling of a button by using the data-toggle attribute.{{/i}}
<button type="button" class="btn" data-toggle="button" >…</button>

$().button('loading')

{{_i}}Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text.{{/i}}

<button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
{{_i}}Heads up!{{/i}} {{_i}}Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off".{{/i}}

$().button('reset')

{{_i}}Resets button state - swaps text to original text.{{/i}}

$().button(string)

{{_i}}Resets button state - swaps text to any data defined text state.{{/i}}

<button type="button" class="btn" data-complete-text="finished!" >...</button>
<script>
  $('.btn').button('complete')
</script>

{{_i}}About{{/i}}

{{_i}}Get base styles and flexible support for collapsible components like accordions and navigation.{{/i}}

* {{_i}}Requires the Transitions plugin to be included.{{/i}}

{{_i}}Example accordion{{/i}}

{{_i}}Using the collapse plugin, we built a simple accordion style widget:{{/i}}

Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
{{! /example }}
<div class="accordion" id="accordion2">
  <div class="accordion-group">
    <div class="accordion-heading">
      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
        {{_i}}Collapsible Group Item #1{{/i}}
      </a>
    </div>
    <div id="collapseOne" class="accordion-body collapse in">
      <div class="accordion-inner">
        Anim pariatur cliche...
      </div>
    </div>
  </div>
  <div class="accordion-group">
    <div class="accordion-heading">
      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
        {{_i}}Collapsible Group Item #2{{/i}}
      </a>
    </div>
    <div id="collapseTwo" class="accordion-body collapse">
      <div class="accordion-inner">
        Anim pariatur cliche...
      </div>
    </div>
  </div>
</div>
...

{{_i}}You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.{{/i}}

<button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
  {{_i}}simple collapsible{{/i}}
</button>

<div id="demo" class="collapse in"> … </div>

{{_i}}Usage{{/i}}

{{_i}}Via data attributes{{/i}}

{{_i}}Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.{{/i}}

{{_i}}To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.{{/i}}

{{_i}}Via JavaScript{{/i}}

{{_i}}Enable manually with:{{/i}}

$(".collapse").collapse()

{{_i}}Options{{/i}}

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-parent="".{{/i}}

{{_i}}Name{{/i}} {{_i}}type{{/i}} {{_i}}default{{/i}} {{_i}}description{{/i}}
{{_i}}parent{{/i}} {{_i}}selector{{/i}} false {{_i}}If selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior){{/i}}
{{_i}}toggle{{/i}} {{_i}}boolean{{/i}} true {{_i}}Toggles the collapsible element on invocation{{/i}}

{{_i}}Methods{{/i}}

.collapse({{_i}}options{{/i}})

{{_i}}Activates your content as a collapsible element. Accepts an optional options object.{{/i}}

$('#myCollapsible').collapse({
  toggle: false
})

.collapse('toggle')

{{_i}}Toggles a collapsible element to shown or hidden.{{/i}}

.collapse('show')

{{_i}}Shows a collapsible element.{{/i}}

.collapse('hide')

{{_i}}Hides a collapsible element.{{/i}}

{{_i}}Events{{/i}}

{{_i}}Bootstrap's collapse class exposes a few events for hooking into collapse functionality.{{/i}}

{{_i}}Event{{/i}} {{_i}}Description{{/i}}
{{_i}}show{{/i}} {{_i}}This event fires immediately when the show instance method is called.{{/i}}
{{_i}}shown{{/i}} {{_i}}This event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).{{/i}}
{{_i}}hide{{/i}} {{_i}}This event is fired immediately when the hide method has been called.{{/i}}
{{_i}}hidden{{/i}} {{_i}}This event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).{{/i}}
$('#myCollapsible').on('hidden', function () {
  // {{_i}}do something…{{/i}}
})

{{_i}}Example{{/i}}

{{_i}}A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.{{/i}}

{{! /example }}
<input type="text" data-provide="typeahead">

You'll want to set autocomplete="off" to prevent default browser menus from appearing over the Bootstrap typeahead dropdown.


{{_i}}Usage{{/i}}

{{_i}}Via data attributes{{/i}}

{{_i}}Add data attributes to register an element with typeahead functionality as shown in the example above.{{/i}}

{{_i}}Via JavaScript{{/i}}

{{_i}}Call the typeahead manually with:{{/i}}

$('.typeahead').typeahead()

{{_i}}Options{{/i}}

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-source="".{{/i}}

{{_i}}Name{{/i}} {{_i}}type{{/i}} {{_i}}default{{/i}} {{_i}}description{{/i}}
{{_i}}source{{/i}} {{_i}}array, function{{/i}} [ ] {{_i}}The data source to query against. May be an array of strings or a function. The function is passed two arguments, the query value in the input field and the process callback. The function may be used synchronously by returning the data source directly or asynchronously via the process callback's single argument.{{/i}}
{{_i}}items{{/i}} {{_i}}number{{/i}} 8 {{_i}}The max number of items to display in the dropdown.{{/i}}
{{_i}}minLength{{/i}} {{_i}}number{{/i}} {{_i}}1{{/i}} {{_i}}The minimum character length needed before triggering autocomplete suggestions{{/i}}
{{_i}}matcher{{/i}} {{_i}}function{{/i}} {{_i}}case insensitive{{/i}} {{_i}}The method used to determine if a query matches an item. Accepts a single argument, the item against which to test the query. Access the current query with this.query. Return a boolean true if query is a match.{{/i}}
{{_i}}sorter{{/i}} {{_i}}function{{/i}} {{_i}}exact match,
case sensitive,
case insensitive{{/i}}
{{_i}}Method used to sort autocomplete results. Accepts a single argument items and has the scope of the typeahead instance. Reference the current query with this.query.{{/i}}
{{_i}}updater{{/i}} {{_i}}function{{/i}} {{_i}}returns selected item{{/i}} {{_i}}The method used to return selected item. Accepts a single argument, the item and has the scope of the typeahead instance.{{/i}}
{{_i}}highlighter{{/i}} {{_i}}function{{/i}} {{_i}}highlights all default matches{{/i}} {{_i}}Method used to highlight autocomplete results. Accepts a single argument item and has the scope of the typeahead instance. Should return html.{{/i}}

{{_i}}Methods{{/i}}

.typeahead({{_i}}options{{/i}})

{{_i}}Initializes an input with a typeahead.{{/i}}

{{_i}}Example{{/i}}

{{_i}}The subnavigation on the left is a live demo of the affix plugin.{{/i}}


{{_i}}Usage{{/i}}

{{_i}}Via data attributes{{/i}}

{{_i}}To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. Then use offsets to define when to toggle the pinning of an element on and off.{{/i}}

<div data-spy="affix" data-offset-top="200">...</div>
{{_i}}Heads up!{{/i}} {{_i}}You must manage the position of a pinned element and the behavior of its immediate parent. Position is controlled by affix, affix-top, and affix-bottom. Remember to check for a potentially collapsed parent when the affix kicks in as it's removing content from the normal flow of the page.{{/i}}

{{_i}}Via JavaScript{{/i}}

{{_i}}Call the affix plugin via JavaScript:{{/i}}

$('#navbar').affix()

{{_i}}Options{{/i}}

{{_i}}Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset-top="200".{{/i}}

{{_i}}Name{{/i}} {{_i}}type{{/i}} {{_i}}default{{/i}} {{_i}}description{{/i}}
{{_i}}offset{{/i}} {{_i}}number | function | object{{/i}} {{_i}}10{{/i}} {{_i}}Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and left directions. To listen for a single direction, or multiple unique offsets, just provide an object offset: { x: 10 }. Use a function when you need to dynamically provide an offset (useful for some responsive designs).{{/i}}
{{! /span9 }}
{{! row}}
{{! /.container }}