Skip to content

Commit 57489be

Browse files
chore(alert): remaining alert content
Image updates
1 parent a687ac3 commit 57489be

44 files changed

Lines changed: 3038 additions & 61 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/documentation-site/patternfly-docs/content/design-guidelines/components/alert/alert.md

Lines changed: 95 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ section: components
44
related: ['Alert', 'Alert group']
55
---
66

7+
import '../components.css';
8+
79
## Elements
810

911
### Alerts
12+
1013
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.
11-
12-
<img src="./img/alert-types.png" alt="Alert types" width="868" />
1314

14-
1. **Status area**: The status area indicates the severity of the alert with a specific icon and color.
15+
<div class="ws-docs-content-img">
16+
![Alert types](./img/alert-types.svg)
17+
</div>
18+
19+
1. **Status area**: The status area indicates the severity of the alert with a specific icon and color.
1520

1621
2. **Alert title**: The alert title concisely communicates the alert’s main message. Its text color is coded to match the alert type.
1722

@@ -27,18 +32,22 @@ Alert elements vary depending on the variation of alert. Toast alerts are always
2732

2833
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.
2934

30-
<img src="./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+
<div class="ws-docs-content-img">
36+
![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.](./img/alert-group-elements.svg)
37+
</div>
3138

3239
1. **Newest notification:** Always appears at the top of the alert group.
3340
2. **Second newest notification:** Moves down when a newer notification surfaces.
3441
3. **Oldest notification:** Continues to move down the stack as newer notifications surface, until a user closes it.
3542
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.
3643

37-
3844
### Communicating severity
45+
3946
The status icon, background, and alert title are coded to communicate the severity of an alert.
4047

41-
<img src="./img/alert-status.png" alt="alert styles" width="700" />
48+
<div class="ws-docs-content-img">
49+
![Alert status](./img/alert-status.svg)
50+
</div>
4251

4352
|Type |Icon |Usage |
4453
|---------|--------|--------------|
@@ -51,12 +60,13 @@ The status icon, background, and alert title are coded to communicate the severi
5160
For more information about what colors to use for status and severity, visit the [Colors page](/design-foundations/colors/#status-and-state-colors).
5261

5362
## 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.
5565

5666
### Customizing alerts
57-
67+
5868
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+
6070
View custom alerts in action in our [custom alert examples](/components/alert#custom-icons).
6171

6272
### Managing overflow
@@ -65,31 +75,40 @@ If you don't want multiple alerts to stack and fill the screen until the user di
6575

6676
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.
6777

68-
<img src="./img/alert-group-with-overflow.png" alt="An example of an alert group with overflow footer" width="662" />
78+
<div class="ws-docs-content-img">
79+
![An example of an alert group with overflow footer](./img/alert-group-with-overflow.svg)
80+
</div>
6981

7082
See our [toast alert guidelines](#using-toast-alerts) for more information about using toast alerts.
7183

7284
## Placement
85+
7386
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.
7487

7588
### Toast alerts
89+
7690
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.
77-
78-
![toast notification placement](./img/toast-notification.png)
79-
91+
92+
<div class="ws-docs-content-img">
93+
![Toast notification placement](./img/toast-notification.svg)
94+
</div>
8095

8196
#### Using toast alerts
97+
8298
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+
84100
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.
85-
86-
![alert group](./img/toast-notification-multiple.png)
87-
101+
102+
<div class="ws-docs-content-img">
103+
![alert group](./img/toast-notification-multiple.svg)
104+
</div>
105+
88106
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+
90108
<img src="./img/Toast-alerts-desktop.png" alt="toast alerts in a page" />
91-
109+
92110
Toast alerts are commonly used in the following situations:
111+
93112
- Confirming that a message sent
94113
- Confirming that an update was made
95114
- Informing the user that their action was completed successfully
@@ -103,118 +122,133 @@ Toast alerts are commonly used in the following situations:
103122

104123
<img src="./img/alert-group-mobile.png" alt="An example of a centered toast alert group over a mobile view." width="375" />
105124

106-
<img src="./img/alert-group-mobile.png" alt="An example of a centered toast alert group over a mobile view." width="375" />
107-
108125
See our [toast alert guidelines](#using-toast-alerts) for more information about using toast alerts.
109126

110-
111127
### Bordered inline alerts
128+
112129
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.
113130

114131
![inline notification placement](./img/inline-notification.png)
115132

116133
#### Using bordered inline alerts
134+
117135
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+
121139
<img src="./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-
<img src="./img/Inline-alert-specific-context.png" alt="inline alert inline with content" />
126140

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+
<img src="./img/Inline-alert-specific-context.png" alt="inline alert inline with content" />
128144

129-
<img src="./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.
130146

131-
<img src="./img/inline-alert-page-level-with-link-two.png" alt="inline alert inline with link demo 2" />
147+
<div class="ws-docs-content-img">
148+
![inline alert inline with link demo](./img/inline-alert-page-level-with-link-one.svg)
149+
</div>
132150

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.
134152

135153
<img src="./img/Multiplealert.png" alt="multiple alerts on a page" />
136154

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+
<div class="ws-docs-content-img">
158+
![multiple alerts on a page demo 2](./img/inline-alert-modal-with-link-two.svg)
159+
</div>
138160

139161
<img src="./img/inline-alert-modal-with-link-two.png" alt="multiple alerts on a page demo 2" />
140162

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.
142164

143-
<img src="./img/inline-alert-modal-with-existing-alert.png" alt="multiple alerts on a modal with existing alert" />
165+
<div class="ws-docs-content-img">
166+
![multiple alerts on a modal with existing alert](./img/inline-alert-modal-with-existing-alert.svg)
167+
</div>
144168

145169
**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.
148170

149-
150-
<img src="./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.
151172

173+
<div class="ws-docs-content-img">
174+
![Alert with radio button options](./img/option-alert.svg)
175+
</div>
152176

153177
Bordered inline alerts are commonly used in the following situations:
178+
154179
- Informing the user that the information they entered into a form field isn’t valid
155180
- Informing the user of something that needs their attention
156181
- Informing the user that they need to set something up
157182
- Informing the user that a feature is temporarily unavailable
158183

159184
### Plain inline alerts
185+
160186
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.
161-
162-
![plain inline notification placement](./img/plain-inline-notification.png)
187+
188+
<div class="ws-docs-content-img">
189+
![plain inline notification placement](./img/plain-inline-notification.svg)
190+
</div>
163191

164192
#### Using plain inline alerts
165-
193+
166194
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.
167195

168196
Plain inline alerts are non-dismissible, and it is not recommended to use them with actions or links.
169197

170198
**Using plain inline alerts on tabbed pages:**
171199

172200
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+
173202
- 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-
![alert group](./img/inline-header-alert.png)
176-
203+
204+
<div class="ws-docs-content-img">
205+
![Alert in page header section](./img/inline-header-alert.svg)
206+
</div>
207+
177208
- 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”:
178-
179-
![alert group](./img/below-tab-alert.png)
180-
209+
210+
<div class="ws-docs-content-img">
211+
![Alert below tab content](./img/below-tab-alert.svg)
212+
</div>
213+
181214
Plain inline alerts are commonly used in the following situations:
215+
182216
- Informing the user of something that needs their attention
183217
- Informing the user that a temporary error has occurred
184218
- Informing the user that a feature is temporarily unresponsive
185219

186220
## Content considerations
187-
221+
188222
- In inline alerts and toast alerts, avoid using “success” and “successfully.” They’re extraneous.
189-
223+
190224
<div class="ws-content-table">
191-
225+
192226
| **Do** | **Don’t** |
193227
|:------:|:---------:|
194228
| Account created| Your account was successfully created.|
195-
229+
196230
</div>
197-
231+
198232
- Be concise. In one-line toast alerts, use fragments instead of sentences if possible.
199-
233+
200234
<div class="ws-content-table">
201-
235+
202236
| **Do** | **Don’t** |
203237
|:------:|:---------:|
204238
| Message sent| Your message has been sent.|
205-
239+
206240
</div>
207241

208242
- 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+
210244
<div class="ws-content-table">
211-
245+
212246
| **Do** | **Don’t** |
213247
|:------:|:---------:|
214248
| From the **Settings** tab, click **View logs.**| **View logs**|
215-
249+
216250
</div>
217-
251+
218252
## Accessibility
219253

220254
For information regarding accessibility, visit the [alert accessibility](/components/alert/accessibility) tab.

0 commit comments

Comments
 (0)