--- title: Reveal description: Modal dialogs, or pop-up windows, are handy for prototyping and production. Foundation includes Reveal, our jQuery modal plugin, to make this easy for you. sass: scss/components/_reveal.scss js: js/foundation.reveal.js video: vnT3bp07iHI mui: true tags: - modal ---

We hope you’re loving these free documentation videos! If you’d like to really accelerate your learning and master the world of front-end development, our Foundation online webinar training is the answer.

See the upcoming Foundation trainings →
## Basics A modal is just an empty container, so you can put any kind of content inside it, from text to forms to video to an entire grid.

Please note that we removed the option for AJAX loaded modals in Foundation 6. We did make it very easy to implement on your own though, check out a sample in the Advanced section.

To create a modal, add the class `.reveal`, the attribute `data-reveal`, and a unique ID to a container.

Watch this part in video

edit on codepen button
```html_example

Awesome. I Have It.

Your couch. It is mine.

I'm a cool paragraph that lives inside of an even cooler modal. Wins!

``` You'll also need a way to open the modal. Add the attribute `data-open` to any element. The value of `data-open` should be the ID of the modal. ```html_example

``` You'll also need a way to *close* the modal from inside. By default, modals will close if clicked outside of, or if the esc key is pressed. However, you'll generally also want to add your own click trigger. Add the attribute `data-close` to any element within the modal to add one. You can use our handy [close button](close-button.html) styles to do this: ```html ``` --- ## Sizing On small screens, a modal is always 100% of the width of the screen. On medium-sized screens and larger, the width changes to 600px (see the `$reveal-width` setting). The size of a modal can be changed with these sizing classes, which are added to the modal container: - `.tiny`: 30% wide - `.small`: 50% wide - `.large`: 90% wide - `.full`: 100% width *and* height, defaults the `escClose` option to true, as well as creates a close button.

Watch this part in video

edit on codepen button
```html
```

OH I'M SO TIIINY

I may be small, but I've got a big heart!

I'm big, like bear!

--- ## Nested Modal It's possible for modals to open other modals. Create a second modal with a unique ID, and then add a click trigger with `data-open` inside the first modal.
edit on codepen button
```html_example

Awesome!

I have another modal inside of me!

ANOTHER MODAL!!!

``` --- ## Full-screen A full-screen modal is 100% of the width *and* height of the window. Add the `.full` class to make it go.

Watch this part in video

edit on codepen button
```html_example

OH I'M SO FUUUUL

Introspective Cage
``` ## Advanced Options ### No Overlay To remove the overlay, add the attribute `data-overlay="false"` to the modal.
edit on codepen button
```html_example

I feel so free!

``` --- ### Animations To use animations from the Motion UI library, include the data-animation-in="someAnimationIn" and data-animation-out="someAnimationOut" attributes. If you want to adjust the speed or timing, include it the attributes like data-animation-in="someAnimationIn fast".

Watch this part in video

edit on codepen button
```html_example

Whoa, I'm dizzy!

There are many options for animating modals, check out the Motion UI library to see them all

``` --- ### AJAX To use AJAX to load your modal content, use the code snippet below. ```js var $modal = $('#modal'); $.ajax('/url') .done(function(resp){ $modal.html(resp).foundation('open'); }); ``` --- ## Accessibility Modals by default are accessible through the use of various ARIA attributes. To make a modal even more accessible, designate a label to the modal by adding `aria-labelledby="exampleModalHeader11"` to the container and `id="exampleModalHeader11"` to the element you want to designate as the label.
edit on codepen button
```html_example

Label for the Modal!

I am even more accessible than the other modals.

```