|
| 1 | +--- |
| 2 | +title: Dialog |
| 3 | +path: components/dialog |
| 4 | +status: Alpha |
| 5 | +source: 'https://github.com/github/github/tree/master/app/assets/stylesheets/experiments/modal-dialog.scss' |
| 6 | +bundle: dialog |
| 7 | +--- |
| 8 | + |
| 9 | +Please note that the `<div>` element with `id="fake-container"` is not included in the component. |
| 10 | + |
| 11 | +```html live |
| 12 | +<div id="fake-container" style="height: 400px;"> |
| 13 | + <button class="btn"><span>Open dialog</span></button> |
| 14 | + <div |
| 15 | + id="overlay-backdrop" |
| 16 | + class="Overlay-backdrop Overlay-backdrop--center" |
| 17 | + role="dialog" |
| 18 | + aria-labelledby="title-id" |
| 19 | + aria-describedby="description-id" |
| 20 | + data-focus-trap="active" |
| 21 | + > |
| 22 | + <div |
| 23 | + class="Overlay Overlay--width-medium Overlay--height-medium Overlay--motion-scaleFade" |
| 24 | + data-focus-trap="active" |
| 25 | + open="" |
| 26 | + > |
| 27 | + <header class="Overlay-header"> |
| 28 | + <div class="Overlay-headerContentWrap"> |
| 29 | + <div class="Overlay-titleWrap"> |
| 30 | + <h1 id="title-id" class="Overlay-title">This is the title of the dialog</h1> |
| 31 | + <h2 id="description-id" class="Overlay-description">This is the subtitle of the dialog</h2> |
| 32 | + </div> |
| 33 | + <div class="Overlay-actionWrap"> |
| 34 | + <button class="Overlay-closeButton" aria-label="Close"> |
| 35 | + <svg aria-hidden="true" viewBox="0 0 16 16" width="16" height="16" fill="currentColor"> |
| 36 | + <path |
| 37 | + fill-rule="evenodd" |
| 38 | + d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z" |
| 39 | + ></path> |
| 40 | + </svg> |
| 41 | + </button> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + </header> |
| 45 | + <div class="Overlay-body"> |
| 46 | + This is the body of the dialogThis is the body of the dialogThis is the body of the dialog This is the body of |
| 47 | + the dialog This is the body of the dialog This is the body of the dialog This is the body of the dialog This is |
| 48 | + the body of the dialog This is the body of the dialog |
| 49 | + </div> |
| 50 | + <footer class="Overlay-footer Overlay-footer--divided Overlay-footer--alignEnd"> |
| 51 | + <button class="btn"><span>Continue</span></button> |
| 52 | + </footer> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | +</div> |
| 56 | +``` |
| 57 | + |
| 58 | +[aria attributes]: https://www.w3.org/TR/html-aria/#allowed-aria-roles-states-and-properties |
0 commit comments