Modals

Static example

A rendered modal with header, body, and set of actions in the footer.

<div class="modal">
  <div class="dialog">
    <div class="content">
      <div class="header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
        <h4>Modal title</h4>
      </div>
      <div class="body">
        <p>One fine body&hellip;</p>
      </div>
      <div class="footer">
        <button type="button" data-dismiss="modal">Close</button>
        <button type="button" class="primary">Save changes</button>
      </div>
    </div><!-- /.content -->
  </div><!-- /.dialog -->
</div><!-- /.modal -->

Live demo

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

<!-- Button trigger modal -->
<button class="btn primary large" data-toggle="modal" data-target="#live-modal">Launch demo modal</button>

<!-- Modal -->
<div class="modal fade" id="live-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="dialog">
    <div class="content">
      <div class="header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
        <h4 id="myModalLabel">Modal title</h4>
      </div>
      <div class="body">
        ...
      </div>
      <div class="footer">
        <button type="button" data-dismiss="modal">Close</button>
        <button type="button" class="primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

Optional sizes

Modals have two optional sizes, available via modifier classes to be placed on a .dialog.

<button class="btn primary" data-toggle="modal" data-target="#small-live-modal">Small modal</button>

<div id="small-live-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
  <div class="dialog small">
    <div class="content">
      ...
    </div>
  </div>
</div>

<button class="btn primary" data-toggle="modal" data-target="#large-live-modal">Large modal</button>

<div id="small-live-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
  <div class="dialog larger">
    <div class="content">
      ...
    </div>
  </div>
</div>

Remove animation

For modals that simply appear rather than fade in to view, remove the .fade class from your modal markup.

<div class="modal" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true">
  ...
</div>