Dialogs elicit a response or reveal critical information without losing the context of the underlying page.
Use to communicate critical information.
<div role="dialog" class="mds-dialog ">
<span class="mds-dialog__message">You have uploaded an incorrect file type, please only upload .xls files.</span>
<div class="mds-dialog__action-buttons">
<div class="mds-dialog__cancel-resolve-buttons-holder">
<button class="mds-button mds-dialog__cancel-button" type="button" role="button"> Cancel </button>
</div>
</div>
</div>
escape
key.Use to communicate critical information that presents the user with a choice.
<div role="dialog" class="mds-dialog ">
<span class="mds-dialog__message">Turning off logic mode will remove all parentheses and change the connection between all widgets back to “and”. Are you sure you want to proceed?</span>
<div class="mds-dialog__action-buttons">
<div class="mds-dialog__cancel-resolve-buttons-holder">
<button class="mds-button mds-dialog__cancel-button" type="button" role="button"> Cancel </button>
<button class="mds-button mds-dialog__resolve-button mds-button--primary" type="button" role="button"> Continue </button>
</div>
</div>
</div>
escape
key or by clicking outside of the dialog.
<div role="dialog" class="mds-dialog ">
<span class="mds-dialog__message">Your Workbook contains unsaved data, do you want to save your changes?</span>
<div class="mds-dialog__action-buttons">
<button class="mds-button mds-dialog__reject-button" type="button" role="button"> Don't save </button>
<div class="mds-dialog__cancel-resolve-buttons-holder">
<button class="mds-button mds-dialog__cancel-button" type="button" role="button"> Cancel </button>
<button class="mds-button mds-dialog__resolve-button mds-button--primary" type="button" role="button"> Save </button>
</div>
</div>
</div>
<div role="dialog" class="mds-dialog ">
<span class="mds-dialog__message">Do you want to save this workbook?
<p> </p>
<label for='mds-dialog-example-input' class='mds-form__label'>Name</label>
<input class="mds-form__input" type="text" id="mds-dialog-example-input" placeholder="Name Untitled Workbook"> </span>
<div class="mds-dialog__action-buttons">
<button class="mds-button mds-dialog__reject-button" type="button" role="button"> Don't save </button>
<div class="mds-dialog__cancel-resolve-buttons-holder">
<button class="mds-button mds-dialog__cancel-button" type="button" role="button"> Cancel </button>
<button class="mds-button mds-dialog__resolve-button mds-button--primary" type="button" role="button"> Save </button>
</div>
</div>
</div>
$mds-color-black
, $mds-opacity-overlay
) to partially block out the underlying page and focus attention on the dialog contents.role=”dialog”
in .mds-dialog
element attributes.aria-describedby
attribute with .mds-dialog
.aria-describedby
attribute should but used to describe the content of the dialog.tabIndex
status for all elements. Then, remove the page element’s tab group and focus status..mds-dialog
.
Class |
Applies to |
Outcome |
---|---|---|
|
|
Indicates that the dialog is a popup. |
|
|
Fades out the |
|
|
Fades out the page overlay with animation. |
closing tag.
tab-index
on the page beneath the page overlay. tab-index
for the underlying page contents.Promise
.Resolve
, Reject
, and Cancel
, which are sufficient for mapping the prime, reject and close buttons.Promise
s. You may need to consider writing your own Promise
/ Deferred
solution in plain JavaScript for asynchronous capturing Resolve
, Reject
and Cancel
user actions..mds-dialog--fadeout
class and .mds-dialog-popup-container__overlay--fadeout
class will animate the dialog.10ms
), then remove the classes.