You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/documentation-site/patternfly-docs/content/design-guidelines/components/alert/alert.md
+95-61Lines changed: 95 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,19 @@ section: components
4
4
related: ['Alert', 'Alert group']
5
5
---
6
6
7
+
import '../components.css';
8
+
7
9
## Elements
8
10
9
11
### Alerts
12
+
10
13
Alert elements vary depending on the variation of alert. Toast alerts are always dismissible, but bordered inline alerts can be both dismissable and non-dismissible. All other elements are consistent between toast and bordered inline alerts. Plain inline alerts are never dismissable, and consist of only a status area and alert title.
1.**Status area**: The status area indicates the severity of the alert with a specific icon and color.
15
+
<divclass="ws-docs-content-img">
16
+

17
+
</div>
18
+
19
+
1.**Status area**: The status area indicates the severity of the alert with a specific icon and color.
15
20
16
21
2.**Alert title**: The alert title concisely communicates the alert’s main message. Its text color is coded to match the alert type.
17
22
@@ -27,18 +32,22 @@ Alert elements vary depending on the variation of alert. Toast alerts are always
27
32
28
33
An alert group stacks and positions 2 or more alerts in a live region, either in a layer over the main content of a page or inline with the page content. Alert groups should always rank alerts by age, stacking new alerts on top of old ones as they surface.
29
34
30
-
<imgsrc="./img/alert-group-elements.png"alt="An example of an alert group stacked on a page. Each alert is labeled according to its place in the stack hierarchy: Newest on top, second newest in the middle, and oldest on the bottom." />
35
+
<divclass="ws-docs-content-img">
36
+

37
+
</div>
31
38
32
39
1.**Newest notification:** Always appears at the top of the alert group.
33
40
2.**Second newest notification:** Moves down when a newer notification surfaces.
34
41
3.**Oldest notification:** Continues to move down the stack as newer notifications surface, until a user closes it.
35
42
4.**Overflow footer (optional):** Use this when you do not want to display more than a specified number of alerts at the same time on the user's screen. See [Managing overflow](#managing-overflow) for more information about overflow footer interactions.
36
43
37
-
38
44
### Communicating severity
45
+
39
46
The status icon, background, and alert title are coded to communicate the severity of an alert.
@@ -51,12 +60,13 @@ The status icon, background, and alert title are coded to communicate the severi
51
60
For more information about what colors to use for status and severity, visit the [Colors page](/design-foundations/colors/#status-and-state-colors).
52
61
53
62
## Usage
54
-
Use an alert component when you are trying to give the user essential information in a prominent way. More specific use cases differ based on component variation.
63
+
64
+
Use an alert component when you are trying to give the user essential information in a prominent way. More specific use cases differ based on component variation.
55
65
56
66
### Customizing alerts
57
-
67
+
58
68
If your use case falls outside of PatternFly's standard alert variations, use [icons](/design-foundations/icons) and [colors](/design-foundations/colors) to create custom alerts that meet your needs.
59
-
69
+
60
70
View custom alerts in action in our [custom alert examples](/components/alert#custom-icons).
61
71
62
72
### Managing overflow
@@ -65,31 +75,40 @@ If you don't want multiple alerts to stack and fill the screen until the user di
65
75
66
76
The overflow link should be configured to navigate to a place where the user can view and manage a complete list of incoming alerts. If a [notification drawer](/components/notification-drawer) is being used, it should open the drawer. You may customize the text accordingly to reflect the result of clicking the link. However, we recommend displaying the number of new/unread notifications present to give the user feedback about how many additional notifications are remaining to view as in the example below.
67
77
68
-
<imgsrc="./img/alert-group-with-overflow.png"alt="An example of an alert group with overflow footer"width="662" />
78
+
<divclass="ws-docs-content-img">
79
+

80
+
</div>
69
81
70
82
See our [toast alert guidelines](#using-toast-alerts) for more information about using toast alerts.
71
83
72
84
## Placement
85
+
73
86
Toast alerts should be placed in an alert group in the upper-right corner of a page. Use 8px of padding between each alert in an alert group. Alert group alignment on a page will depend on your use case.
74
87
75
88
### Toast alerts
89
+
76
90
Toast alerts communicate information about an update, confirmation, or other activity. A toast alert overlays content in the upper-right corner of the page and disappears when it times out or when the user dismisses it.
Use toast alerts to communicate an update, confirmation, or other activity to the user without blocking their workflow. For example, you can use a toast alert to inform the user that their message was sent. You can include links in a toast alert for a user to take action on the event that surfaced the alert, but the links should only be a shortcut for the user. A toast alert should never be used as the only means for taking actions on an alert event.
83
-
99
+
84
100
Toast alerts stack in the upper-right corner of a page. To properly position and stack a set of alerts, use an [alert group](#alert-groups) component. When alerts stack, the most recent alert appears at the top, and others move down as more alerts come in. When alerts are deleted, the remaining alerts move up.
Toast alerts should always have a close button so that the user can dismiss them. If you include an automatic timeout for your toast alert, 8 seconds is recommended. Toast alerts should not disappear while the user is hovering over them.
89
-
107
+
90
108
<imgsrc="./img/Toast-alerts-desktop.png"alt="toast alerts in a page" />
91
-
109
+
92
110
Toast alerts are commonly used in the following situations:
111
+
93
112
- Confirming that a message sent
94
113
- Confirming that an update was made
95
114
- Informing the user that their action was completed successfully
@@ -103,118 +122,133 @@ Toast alerts are commonly used in the following situations:
103
122
104
123
<imgsrc="./img/alert-group-mobile.png"alt="An example of a centered toast alert group over a mobile view."width="375" />
105
124
106
-
<imgsrc="./img/alert-group-mobile.png"alt="An example of a centered toast alert group over a mobile view."width="375" />
107
-
108
125
See our [toast alert guidelines](#using-toast-alerts) for more information about using toast alerts.
109
126
110
-
111
127
### Bordered inline alerts
128
+
112
129
Bordered inline alerts communicate information about a specific user action on a page. An inline alert appears within the content area and disappears when the user closes it or navigates away from the page.
Use bordered inline alerts to return feedback as the result of a user action within a page without blocking the user’s workflow. Common uses for bordered inline alerts include form validation and warning messages.
118
-
119
-
***If an alert message applies globally to the content on a page,** place the alert in the page header area just below the title.
120
-
136
+
137
+
-**If an alert message applies globally to the content on a page,** place the alert in the page header area just below the title.
138
+
121
139
<imgsrc="./img/Inline-alert-page-level.png"alt="global inline alert in a page" />
122
-
123
-
***If the alert applies only to specific content,** place it inline with the page content to call attention to the error.
124
-
125
-
<imgsrc="./img/Inline-alert-specific-context.png"alt="inline alert inline with content" />
126
140
127
-
***If the alert is being used to indicate errors,** use an error validation summary at the top of the page to indicate what errors are present. The summary should be a quick, general overview. Show an error alert next to the field that is causing the error. The error message should be concise and actionable. It should tell the user what happened and the next steps needed to fix it.
141
+
-**If the alert applies only to specific content,** place it inline with the page content to call attention to the error.
142
+
143
+
<imgsrc="./img/Inline-alert-specific-context.png"alt="inline alert inline with content" />
128
144
129
-
<imgsrc="./img/inline-alert-page-level-with-link-one.png"alt="inline alert inline with link demo 1" />
145
+
-**If the alert is being used to indicate errors,** use an error validation summary at the top of the page to indicate what errors are present. The summary should be a quick, general overview. Show an error alert next to the field that is causing the error. The error message should be concise and actionable. It should tell the user what happened and the next steps needed to fix it.
130
146
131
-
<imgsrc="./img/inline-alert-page-level-with-link-two.png"alt="inline alert inline with link demo 2" />
147
+
<divclass="ws-docs-content-img">
148
+

149
+
</div>
132
150
133
-
***If multiple errors are present in the same location,** order them from most to least severe.
151
+
-**If multiple errors are present in the same location,** order them from most to least severe.
134
152
135
153
<imgsrc="./img/Multiplealert.png"alt="multiple alerts on a page" />
136
154
137
-
***If the alert is being used to indicate errors on a modal,** use an error validation summary at the top of the modal below the title to indicate what errors are present. Show an error alert next to the field that is causing the error. The error message should be concise and actionable. It should tell the user what happened and the next steps needed to fix it.
155
+
-**If the alert is being used to indicate errors on a modal,** use an error validation summary at the top of the modal below the title to indicate what errors are present. Show an error alert next to the field that is causing the error. The error message should be concise and actionable. It should tell the user what happened and the next steps needed to fix it.
156
+
157
+
<divclass="ws-docs-content-img">
158
+

159
+
</div>
138
160
139
161
<imgsrc="./img/inline-alert-modal-with-link-two.png"alt="multiple alerts on a page demo 2" />
140
162
141
-
***If the alert is being used to indicate errors on a modal with an existing alert,** display the new alert above the existing alert.
163
+
-**If the alert is being used to indicate errors on a modal with an existing alert,** display the new alert above the existing alert.
142
164
143
-
<imgsrc="./img/inline-alert-modal-with-existing-alert.png"alt="multiple alerts on a modal with existing alert" />
165
+
<divclass="ws-docs-content-img">
166
+

167
+
</div>
144
168
145
169
**The user can dismiss an information alert by using the close button.** Error-related alerts (warning and critical severity) should disappear only when the underlying issue that caused the alert is resolved. However, if the issue cannot be resolved on the current page, use a [modal](/components/modal) instead of an inline alert to provide user the options to proceed.
146
-
147
-
In addition to static message content and links, **you have the option of including interactive elements** in the body of an inline alert to ask the user for further input or feedback.
148
170
149
-
150
-
<imgsrc="./img/option-alert.png"alt="alert with radio button options"width="439px" />
171
+
In addition to static message content and links, **you have the option of including interactive elements** in the body of an inline alert to ask the user for further input or feedback.
151
172
173
+
<divclass="ws-docs-content-img">
174
+

175
+
</div>
152
176
153
177
Bordered inline alerts are commonly used in the following situations:
178
+
154
179
- Informing the user that the information they entered into a form field isn’t valid
155
180
- Informing the user of something that needs their attention
156
181
- Informing the user that they need to set something up
157
182
- Informing the user that a feature is temporarily unavailable
158
183
159
184
### Plain inline alerts
185
+
160
186
Plain inline alerts communicate information about a temporarily persistent error or other activity. A plain inline alert is less visually intrusive than a bordered inline alert, and is designed to be placed in content-heavy areas, such as within a form, wizard, or drawer. This alert type persists until the error or action is resolved.
Use plain inline alerts to communicate non-imperative messages to the user without adding visual clutter. This alert type is particularly helpful within other components, such as wizards, drawers, modals, side panels, and popovers, which may already contain a lot of information.
167
195
168
196
Plain inline alerts are non-dismissible, and it is not recommended to use them with actions or links.
169
197
170
198
**Using plain inline alerts on tabbed pages:**
171
199
172
200
On a tabbed page that has a gray background, inline alerts do not offer enough contrast. Using them in this context requires additional formatting.
201
+
173
202
- If the alert is relevant to the entire page and all the tabs within the page, it should be placed on the header:
174
-
175
-

176
-
203
+
204
+
<divclass="ws-docs-content-img">
205
+

206
+
</div>
207
+
177
208
- If the alert is not relevant to the entire page, the white header area should be extended below the tab and separated from the tabs by a gray line. Place the plain inline alert in the resulting “banner”:
Plain inline alerts are commonly used in the following situations:
215
+
182
216
- Informing the user of something that needs their attention
183
217
- Informing the user that a temporary error has occurred
184
218
- Informing the user that a feature is temporarily unresponsive
185
219
186
220
## Content considerations
187
-
221
+
188
222
- In inline alerts and toast alerts, avoid using “success” and “successfully.” They’re extraneous.
189
-
223
+
190
224
<divclass="ws-content-table">
191
-
225
+
192
226
|**Do**|**Don’t**|
193
227
|:------:|:---------:|
194
228
| Account created| Your account was successfully created.|
195
-
229
+
196
230
</div>
197
-
231
+
198
232
- Be concise. In one-line toast alerts, use fragments instead of sentences if possible.
199
-
233
+
200
234
<divclass="ws-content-table">
201
-
235
+
202
236
|**Do**|**Don’t**|
203
237
|:------:|:---------:|
204
238
| Message sent| Your message has been sent.|
205
-
239
+
206
240
</div>
207
241
208
242
- In toast alerts containing links, describe how the user can navigate through the UI to perform the action. Learn more about how descriptive text supports accessibility in the next section.
209
-
243
+
210
244
<divclass="ws-content-table">
211
-
245
+
212
246
|**Do**|**Don’t**|
213
247
|:------:|:---------:|
214
248
| From the **Settings** tab, click **View logs.**|**View logs**|
215
-
249
+
216
250
</div>
217
-
251
+
218
252
## Accessibility
219
253
220
254
For information regarding accessibility, visit the [alert accessibility](/components/alert/accessibility) tab.
0 commit comments