Use a modal for dialog boxes, confirmation messages, or other content that can be called up. In order for the modal to work you have to add the Modal ID to the link of the trigger. To add a close button, just add the class .modal-close
to
your button.
<!-- Modal Trigger --> <a class="waves-effect waves-light btn modal-trigger" href="#modal1">Modal</a> <!-- Modal Structure --> <div id="modal1" class="modal"> <div class="modal-content"> <h4>Modal Header</h4> <p>Text</p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-red btn-flat ">Disagree</a> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">Agree</a> </div> </div>
<!-- Modal Trigger --> <a class="waves-effect waves-light btn modal-trigger" href="#modal2">Modal</a> <!-- Modal Structure --> <div id="modal2" class="modal modal-fixed-footer"> <div class="modal-content flow-text"> <h4>Modal Header</h4> <p>Text</p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-red btn-flat ">Disagree</a> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">Agree</a> </div> </div>
<!-- Modal Trigger --> <a class="waves-effect waves-light btn modal-trigger" href="#modal3" data-dismissible="true">Modal</a> <!-- Modal Structure --> <div id="modal3" class="modal bottom-sheet"> <div class="modal-content"> <h4>Modal Header</h4> <p>Text</p> </div> </div>
You can customize the behavior of each modal using these options. For example, you can change background opacity or/and show effect speed. To do this, just place in your trigger tag some options.
<!-- Modal Trigger --> <a class="btn modal-trigger" href="#modal1" data-dismissible="true" data-opacity="0.6" data-induration="400" data-outduration="300">Modal</a>