Skip to content

Commit 6175598

Browse files
committed
US206196 added modal documentation.
1 parent d05d3ca commit 6175598

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

elements/pfe-modal/README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
1-
# PatternFly Element | Modal Element
1+
# PatternFly Modal Element
2+
3+
## Overview
4+
5+
`pfe-modal` is a self-contained modal window that is hidden on page load and (when activated) restricts the user from interacting with content in the main window.
6+
7+
## Usage
8+
```html
9+
<pfe-modal>
10+
<button slot="pfe-modal--trigger">Open modal</button>
11+
<h2 slot="pfe-modal--header">Modal with a header</h2>
12+
<p>Lorem ipsum dolor sit amet, <a href="#foo">consectetur adipisicing</a> 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.</p>
13+
<pfe-cta>
14+
<a href="#bar">Learn more</a>
15+
</pfe-cta>
16+
</pfe-modal>
17+
```
18+
19+
## Slots
20+
21+
### Trigger
22+
The only part visible on page load, the trigger opens the modal window. The trigger can be a button, a cta or a link.
23+
24+
### Header
25+
The header is an optional slot that appears at the top of the modal window. It should be a header tag (h2-h6).
26+
27+
### Default slot
28+
The default slot can contain any type of content. When the header is not present this unnamed slot appear at the top of the modal window (to the left of the close button). Otherwise it will appear beneath the header.
29+
30+
## Events
31+
32+
### openModal
33+
Fires when a user clicks on the trigger.
34+
35+
### closeModal
36+
Fires when either a user clicks on either the close button or the overlay.
237

3-
## Dependencies
438

539
Make sure you have [Polyserve][polyserve] and [Web Component Tester][web-component-tester] installed.
640

0 commit comments

Comments
 (0)