You are viewing the deprecated 0.7.0 version of the website. Click here to view the latest version

Modal

A classic modal overlay, in which you can include any content you want

Colors No
Sizes No
Variables Yes

The modal structure is very simple:

  • modal: the main container
    • modal-background: a transparent overlay that can act as a click target to close the modal
    • modal-content: a horizontally and vertically centered container, with a maximum width of 640px, in which you can include any content
    • modal-close: a simple cross located in the top right corner

<div class="modal">
  <div class="modal-background"></div>
  <div class="modal-content">
    <!-- Any other Bulma elements you want -->
  </div>
  <button class="modal-close is-large" aria-label="close"></button>
</div>

To activate the modal, just add the is-active modifier on the .modal container

No JavaScript
Bulma does not include any JavaScript interaction. You will have to implement the class toggle yourself.

Image modal

Because a modal can contain anything you want, you can very simply use it to build an image gallery for example:

Launch image modal

<div class="modal">
  <div class="modal-background"></div>
  <div class="modal-content">
    <p class="image is-4by3">
      <img src="https://versions.bulma.io/0.7.0/images/placeholders/1280x960.png" alt="">
    </p>
  </div>
  <button class="modal-close is-large" aria-label="close"></button>
</div>

Modal card

If you want a more classic modal, with a head, a body and a foot, use the modal-card.

<div class="modal">
  <div class="modal-background"></div>
  <div class="modal-card">
    <header class="modal-card-head">
      <p class="modal-card-title">Modal title</p>
      <button class="delete" aria-label="close"></button>
    </header>
    <section class="modal-card-body">
      <!-- Content ... -->
    </section>
    <footer class="modal-card-foot">
      <button class="button is-success">Save changes</button>
      <button class="button">Cancel</button>
    </footer>
  </div>
</div>

Variables #

You can use these variables to customize this component. Simply set one or multiple of these variables before importing Bulma. Learn how.

Name Default value
Name Default value
$modal-z 20
$modal-background-background-color rgba($black, 0.86)
$modal-content-width 640px
$modal-content-margin-mobile 20px
$modal-content-spacing-mobile 160px
$modal-content-spacing-tablet 40px
$modal-close-dimensions 40px
$modal-close-right 20px
$modal-close-top 20px
$modal-card-spacing 40px
$modal-card-head-background-color $background
$modal-card-head-border-bottom 1px solid $border
$modal-card-head-padding 20px
$modal-card-head-radius $radius-large
$modal-card-title-color $text-strong
$modal-card-title-line-height 1
$modal-card-title-size $size-4
$modal-card-foot-radius $radius-large
$modal-card-foot-border-top 1px solid $border
$modal-card-body-background-color $white
$modal-card-body-padding 20px

Made with Bulma
This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub

#native_company# #native_desc#
#native_cta#
New!

The official Bulma book! 😲

by Jeremy Thomas, creator of Bulma, Oleksii Potiekhin,
Mikko Lauhakari, Aslam Shah and David Berning

A step-by-step guide that teaches you how to build a web interface from scratch using Bulma.

Formats available:
PDF Epub Mobi
or
Kindle

Newsletter

Features, releases, showcase… stay in the loop!