Menu


            Home  /  Features  /  Modals

Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

Static example

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

  1. <div class="modal hide fade">
  2. <div class="modal-header">
  3. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  4. <h3>Modal header</h3>
  5. </div>
  6. <div class="modal-body">
  7. <p>One fine body…</p>
  8. </div>
  9. <div class="modal-footer">
  10. <a href="#" class="btn">Close</a>
  11. <a href="#" class="btn btn-primary">Save changes</a>
  12. </div>
  13. </div>

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.

  1. <!-- Button to trigger modal -->
  2. <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
  3.  
  4. <!-- Modal -->
  5. <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  6. <div class="modal-header">
  7. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  8. <h3 id="myModalLabel">Modal header</h3>
  9. </div>
  10. <div class="modal-body">
  11. <p>One fine body…</p>
  12. </div>
  13. <div class="modal-footer">
  14. <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
  15. <button class="btn btn-primary">Save changes</button>
  16. </div>
  17. </div>