Modal
Overview
A simple two-part modal component, with a triggering link and a modal container. Features:
- Will scroll and resize (mobile safe)
- May contain any amount and type of content
- Close button inserted automatically
- Clicking on the blanket (overlay) closes the modal
- Multiple modals allowed on the same page
Options
data-modal-target
- (required) - ID of modal to trigger
Usage
Create a modal container and assign it a unique id
. This id
will be used to trigger the modal to open.
<div class="modal__dialog" id="unique-id">...</div>
Assign the id
to a link
by using data-modal-target
.
<a data-modal-target="unique-id" href="#">...</a>
Example
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Modal content
Lorem ipsum
You can put any content you want in here.
Modal button
To make the link function like a button assign it the button
class.
Nested components
You can nest components inside the modal.
Modal content
Associate Professor Jane Academic
Email
lorem.ipsum.dolor@sitametconsecteturadipisicing.elit
Location
Room 267, Chemistry Building, Parkville Campus
Address
School of Chemistry, The University of Melbourne, Victoria, 3010,
Australia
Phone
+61 3 9999 0000