To support screen reader user awareness of the dialog text, the dialog text is wrapped in a div that is referenced by aria-describedby.
```
### With help button
```html isFullscreen
Modal title Modal title Modal title Modal title Modal title Modal title Modal title Modal title
A description is used when you want to provide more info about the modal than the title is able to describe. The content in the description is static and will not scroll with the rest of the modal body.
To support screen reader user awareness of the dialog text, the dialog text is wrapped in a div that is referenced by aria-describedby.
```
### Small
```html isFullscreen
Modal title
Static text describing modal purpose. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
```
### Medium
```html isFullscreen
Modal title
Static text describing modal purpose. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
```
### Large
```html isFullscreen
Modal title
Static text describing modal purpose. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
```
### Without title
```html isFullscreen
When static text describing the modal is available, it can be wrapped with an ID referring to the modal's aria-describedby value. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
```
### With description
```html isFullscreen
Modal title
A description is used when you want to provide more info about the modal than the title is able to describe. The content in the description is static and will not scroll with the rest of the modal body.
To support screen reader user awareness of the dialog text, the dialog text is wrapped in a div that is referenced by aria-describedby.
```
### Custom title
```html isFullscreen
Custom title
To support screen reader user awareness of the dialog text, the dialog text is wrapped in a div that is referenced by aria-describedby.
```
### Modal box as generic container
```html isFullscreen
The modal box children elements can be removed, and the modal serves as a generic modal container. One use case of this is when creating a wizard in a modal.
```
### Icon
```html isFullscreen
Modal with icon title
Modal description
```
### Custom alert
```html isFullscreen
Default
alert:
Custom alert modal title
Modal description
```
### Info alert
```html isFullscreen
Info
alert:
Info alert modal title
Modal description
```
### Success alert
```html isFullscreen
Success
alert:
Success alert modal title
Modal description
```
### Warning alert
```html isFullscreen
Warning
alert:
Warning alert modal title
Modal description
```
### Danger alert
```html isFullscreen
Danger
alert:
Danger alert modal title
To support screen reader user awareness of the dialog text, the dialog text is wrapped in a div that is referenced by aria-describedby.
```
### Danger alert with modifier on modal title
The status modifier classes can be applied directly to the modal title element, instead of the parent modal.
```html isFullscreen isBeta
Danger
alert:
Danger alert modal title
To support screen reader user awareness of the dialog text, the dialog text is wrapped in a div that is referenced by aria-describedby.
```
## Documentation
### Overview
A modal box is a generic rectangular container that can be used to build modals. A modal box can have the following sections: header, title, description, body, and footer. With normal use of the modal, a title or body is required. Alternatively, no child elements can be used, and the `.pf-v5-c-modal-box` container will serve as a generic container with no padding for custom modal content. If no `.pf-v5-c-modal-box__title` is used, `aria-label="[title of modal]"` must be provided for `.pf-v5-c-modal-box`.
### Accessibility
| Attribute | Applies to | Outcome |
| -- | -- | -- |
| `role="dialog"` | `.pf-v5-c-modal-box` | Identifies the element that serves as the modal container. **Required** |
| `aria-labelledby="[id value of .pf-v5-c-modal-box__title or custom modal title]"` | `.pf-v5-c-modal-box` | Gives the modal an accessible name by referring to the element that provides the dialog title. **Required when .pf-v5-c-title is present** |
| `aria-label="[title of modal]"` | `.pf-v5-c-modal-box` | Gives the modal an accessible name. **Required when `.pf-v5-c-modal-box__title` is *not* present** |
| `aria-describedby="[id value of applicable content]"` | `.pf-v5-c-modal-box` | Gives the modal an accessible description by referring to the modal content that describes the primary message or purpose of the dialog. Not used if there is no static text that describes the modal. |
| `aria-modal="true"` | `.pf-v5-c-modal-box` | Tells assistive technologies that the windows underneath the current modal are not available for interaction. **Required**|
| `aria-label="Close"` | `.pf-v5-c-modal-box__close .pf-v5-c-button` | Provides an accessible name for the close button as it uses an icon instead of text. **Required**|
| `aria-hidden="true"` | Parent element containing the page contents when modal is open | Hides main contents of the page from screen readers. The element with `.pf-v5-c-modal-box` must not be a descendent of the element with `aria-hidden="true"`. For more info see [trapping focus](/accessibility/product-development-guide#trapping-focus). **Required** |
| `form="[id of form in modal body]"` | `.pf-v5-c-modal-box__footer .pf-v5-c-button` | Associates a submit button in the modal footer with a form in the modal body. For use when the submit button is outside of the `