2.0.0
Notifications float in front of page content and provide information about page-level or out-of-view events. There are four types: error, warning, success, or informational.
That combination of options is invalid.
Name
|
Required
|
Description
|
---|---|---|
Message |
Yes |
Includes the core, most important notification content. |
Type |
Yes |
Affects the color and icon associated with the notification. Choose from error, warning, success or informational. |
Title |
No |
Briefly summarizes notification content. |
List |
No |
Helps structure content below a message element. |
Custom Action |
No |
Offers a follow-up action via secondary Button. |
Dismiss Action |
No |
Enables the user to remove the notification from view. |
Use for page-level errors and malfunctions, such as a file import failure or insufficient permissions to view content, or for errors that occur off of the page, such as failure to generate a report that was being created in the background.
We‘re sorry, the file you are importing timed out. Please try your import again. If your import continues to time out, please email [email protected].
We‘re sorry, the file you are importing timed out. Please try your import again. If your import continues to time out, please email [email protected].
We‘re sorry, the file you are importing timed out. Please try your import again. If your import continues to time out, please email [email protected].
<div class="mds-notification">
<div role="alertdialog" class="mds-notification__item mds-notification__item--error mds-notification__item--dismissible">
<div class="mds-notification__status">
<svg class="mds-icon mds-notification__icon">
<use xlink:href="/icons/mds.svg#alert">
<title>Error</title>
</use>
</svg>
</div>
<div class="mds-notification__body">
<div class="mds-notification__content">
<strong class="mds-notification__title">Import Failure</strong>
<p class="mds-notification__message">We‘re sorry, the file you are importing timed out. Please try your import again. If your import continues to time out, please email <a href='#'>[email protected]</a>.</p>
<button class="mds-button mds-button--small mds-button--secondary" type="button"> Try Again </button>
</div>
</div>
<button class="mds-button mds-notification__dismiss-button mds-button--small mds-button--icon-only" type="button">
<svg class="mds-icon mds-button__icon mds-button__icon--right">
<use xlink:href="/icons/mds.svg#remove--s">
<title>Close</title>
</use>
</svg>
</button>
</div>
</div>
mds-notification--tinted
modifier class.Use for a message requiring attention but not resolution in order to continue, such as sharing a file with someone who does not have permissions to view it.
The user you are attempting to share a file with doesn‘t have permission to view it. Please contact your customer service consultant if you believe this is a mistake.
The user you are attempting to share a file with doesn‘t have permission to view it. Please contact your customer service consultant if you believe this is a mistake.
The user you are attempting to share a file with doesn‘t have permission to view it. Please contact your customer service consultant if you believe this is a mistake.
<div class="mds-notification">
<div role="alert" class="mds-notification__item mds-notification__item--warning mds-notification__item--dismissible">
<div class="mds-notification__status">
<svg class="mds-icon mds-notification__icon">
<use xlink:href="/icons/mds.svg#alert">
<title>Warning</title>
</use>
</svg>
</div>
<div class="mds-notification__body">
<div class="mds-notification__content">
<strong class="mds-notification__title">Permissions Issue</strong>
<p class="mds-notification__message">The user you are attempting to share a file with doesn‘t have permission to view it. Please contact your customer service consultant if you believe this is a mistake.</p>
</div>
</div>
<button class="mds-button mds-notification__dismiss-button mds-button--small mds-button--icon-only" type="button">
<svg class="mds-icon mds-button__icon mds-button__icon--right">
<use xlink:href="/icons/mds.svg#remove--s">
<title>Close</title>
</use>
</svg>
</button>
</div>
</div>
mds-notification--tinted
modifier class.Use for successes and completions, such as a report-generation or file upload completion, sent message confirmation, successfully adding investments to a list, or successfully saving updated settings.
116 investments have been added to your list.
116 investments have been added to your list.
116 investments have been added to your list.
<div class="mds-notification">
<div role="alertdialog" class="mds-notification__item mds-notification__item--success mds-notification__item--dismissible">
<div class="mds-notification__status">
<svg class="mds-icon mds-notification__icon">
<use xlink:href="/icons/mds.svg#check">
<title>Success</title>
</use>
</svg>
</div>
<div class="mds-notification__body">
<div class="mds-notification__content">
<p class="mds-notification__message">116 investments have been added to your list.</p>
<button class="mds-button mds-button--small mds-button--secondary" type="button"> Undo </button>
</div>
</div>
<button class="mds-button mds-notification__dismiss-button mds-button--small mds-button--icon-only" type="button">
<svg class="mds-icon mds-button__icon mds-button__icon--right">
<use xlink:href="/icons/mds.svg#remove--s">
<title>Close</title>
</use>
</svg>
</button>
</div>
</div>
mds-notification--tinted
modifier class.Use for immediate feedback that a background process is happening. For example, a report is being generated or a file is being imported.
We‘ll let you know as soon as it‘s finished.
We‘ll let you know as soon as it‘s finished.
<div class="mds-notification">
<div role="alert" class="mds-notification__item mds-notification__item--dismissible">
<div class="mds-notification__status">
<svg class="mds-icon mds-notification__icon">
<use xlink:href="/icons/mds.svg#info-circle">
<title>Information</title>
</use>
</svg>
</div>
<div class="mds-notification__body">
<div class="mds-notification__content">
<strong class="mds-notification__title">Your Report Is Being Generated</strong>
<p class="mds-notification__message">We‘ll let you know as soon as it‘s finished.</p>
</div>
</div>
<button class="mds-button mds-notification__dismiss-button mds-button--small mds-button--icon-only" type="button">
<svg class="mds-icon mds-button__icon mds-button__icon--right">
<use xlink:href="/icons/mds.svg#remove--s">
<title>Close</title>
</use>
</svg>
</button>
</div>
</div>
Sizing affects text size, icon size, and internal padding. Use small notifications when information density is desired.
Notification message, including a link.
Notification message, including a link.
<div class="mds-notification">
<div role="alertdialog" class="mds-notification__item mds-notification--small mds-notification__item--dismissible">
<div class="mds-notification__status">
<svg class="mds-icon mds-notification__icon">
<use xlink:href="/icons/mds.svg#info-circle--s">
<title>Information</title>
</use>
</svg>
</div>
<div class="mds-notification__body">
<div class="mds-notification__content">
<strong class="mds-notification__title">Notification Title</strong>
<p class="mds-notification__message">Notification message, including <a href='#'>a link</a>.</p>
<ul class="mds-notification__list">
<li class="mds-notification__list-item">List Item 1</li>
<li class="mds-notification__list-item">List Item 2</li>
</ul>
<button class="mds-button mds-button--small mds-button--secondary" type="button"> Take Action </button>
</div>
</div>
<button class="mds-button mds-notification__dismiss-button mds-button--small mds-button--icon-only" type="button">
<svg class="mds-icon mds-button__icon mds-button__icon--right">
<use xlink:href="/icons/mds.svg#remove--s">
<title>Close</title>
</use>
</svg>
</button>
</div>
</div>
Available in two widths, 350px
and 500px
.
Medium notification using the 350px width modifier class.
Medium notification using the default 500px width.
<div class="mds-notification mds-notification--width-350px">
<div role="alert" class="mds-notification__item mds-notification__item--dismissible">
<div class="mds-notification__status">
<svg class="mds-icon mds-notification__icon">
<use xlink:href="/icons/mds.svg#info-circle">
<title>Information</title>
</use>
</svg>
</div>
<div class="mds-notification__body">
<div class="mds-notification__content">
<strong class="mds-notification__title">Medium Notification Title</strong>
<p class="mds-notification__message">Medium notification using the 350px width modifier class.</p>
</div>
</div>
<button class="mds-button mds-notification__dismiss-button mds-button--small mds-button--icon-only" type="button">
<svg class="mds-icon mds-button__icon mds-button__icon--right">
<use xlink:href="/icons/mds.svg#remove--s">
<title>Close</title>
</use>
</svg>
</button>
</div>
</div>
z-index
value when you compose this component with other layered components, e.g., Dialogs, Modals, Popovers or Tooltips to meet your product requirements. $mds-box-shadow-drop
, to float in front of page content.Place notifications at the top center of the viewport to ensure maximum visibility. Consider using this placement for error, warning, and success notifications.
mds-notification--below-masthead
or mds-notification--below-masthead-tall
modifier class to position notifications below the Masthead, so as not to obscure branding.$mds-space-2-x
(16px) between the Masthead and notification.$mds-space-stack-1-x
(8px) between notifications.Place notifications at the bottom right corner of the viewport to avoid disrupting a user’s focus. Consider using this placement for informational notifications.
$mds-space-2-x
(16px) to separate notifications from the edge of the browser window.$mds-space-stack-1-x
(8px) between notifications.Contains a message only, may include a title and/or unordered list.
Contains message, and may include a link, custom action button, and/or unordered list. Use this behavior to ensure a user has an opportunity to act.
For additional editorial guidance, refer to Buttons and Errors documentation.
role="alert"
attribute on the mds-notification
element.role="alertdialog"
when the notification also provides interactive controls, such as an “Undo” button, that provide feedback and dismiss the notification.
Class
|
Applies to
|
Outcome
|
---|---|---|
|
|
Creates a wrapper to hold all notifications within a single location. |
|
|
Applies top padding to ensure that all notifications are below the Masthead. |
|
|
Applies top padding to ensure that notifications are below the Tall Masthead. |
|
|
Toggles visibility of a notification wrapper. |
|
|
Modifies the maximum width from 500px to 350px. |
|
|
Reduces text size, icon size, and internal padding. |
|
|
Positions the notification at the top center of the viewport. |
|
|
Positions the notification at the bottom right of the viewport. |
|
|
Adds padding to the right side of the body of the notification to accommodate the close icon. |
|
|
Invokes a notification by setting the |
|
|
Dismisses the notification by animating a fade-out effect. |
|
|
Applies the green background color and the white icon color to the left side of the component. |
|
|
Applies the yellow background color and the black icon color to the left side of the component. |
|
|
Applies the red background color and the white icon color to the left side of the component. |
|
|
Applies the tinted background color to the body of the component. |