Debian Codegraph @

node/@patternfly/patternfly/docs/components/Alert/examples/Alert.md

raw
1 ---
2 id: Alert
3 section: components
4 cssPrefix: ['pf-v6-c-alert','pf-v6-c-alert-group']
5 ---## Alert examples
6
7 ### Types
8
9 ```html
10 <div class="pf-v6-c-alert pf-m-custom" aria-label="Custom alert">
11 <div class="pf-v6-c-alert__icon">
12 <svg
13 class="pf-v6-svg"
14 fill="currentColor"
15 viewBox="0 0 32 32"
16 aria-hidden="true"
17 role="img"
18 width="1em"
19 height="1em"
20 >
21 <path
22 d="M28.75 22v3.5c0 .689-.561 1.25-1.25 1.25h-7.521c.005.084.021.166.021.25 0 2.206-1.794 4-4 4s-4-1.794-4-4c0-.084.016-.166.021-.25H4.5c-.689 0-1.25-.561-1.25-1.25V22a.75.75 0 0 1 .75-.75c1.24 0 2.25-1.009 2.25-2.25v-4c0-4.826 3.528-8.833 8.138-9.605A2.482 2.482 0 0 1 13.5 3.5C13.5 2.122 14.621 1 16 1s2.5 1.122 2.5 2.5c0 .761-.349 1.436-.888 1.895 4.61.772 8.138 4.779 8.138 9.605v4c0 1.241 1.01 2.25 2.25 2.25a.75.75 0 0 1 .75.75Z"
23 />
24 </svg>
25 </div>
26 <p class="pf-v6-c-alert__title">
27 <span class="pf-v6-screen-reader">Custom alert:</span>
28 Custom alert title
29 </p>
30 </div>
31 <br />
32 <div class="pf-v6-c-alert pf-m-info" aria-label="Information alert">
33 <div class="pf-v6-c-alert__icon">
34 <svg
35 class="pf-v6-svg"
36 fill="currentColor"
37 viewBox="0 0 32 32"
38 aria-hidden="true"
39 role="img"
40 width="1em"
41 height="1em"
42 >
43 <path
44 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm1.5 22a1.5 1.5 0 1 1-3 0v-5.157l-.188.04a1.5 1.5 0 0 1-.625-2.934l1.956-.416c.112-.024.223-.032.333-.03l.024-.002a1.5 1.5 0 0 1 1.5 1.5v7Zm-.08-12.58c-.38.37-.89.58-1.42.58a1.998 1.998 0 0 1-1.851-2.76c.051-.13.11-.24.19-.35.07-.11.15-.21.25-.3.74-.75 2.08-.75 2.83 0 .09.09.17.19.24.3.08.11.14.22.189.35.05.12.09.24.11.37.03.13.04.26.04.39 0 .53-.21 1.04-.58 1.42Z"
45 />
46 </svg>
47 </div>
48 <p class="pf-v6-c-alert__title">
49 <span class="pf-v6-screen-reader">Info alert:</span>
50 Info alert title
51 </p>
52 </div>
53 <br />
54 <div class="pf-v6-c-alert pf-m-success" aria-label="Success alert">
55 <div class="pf-v6-c-alert__icon">
56 <svg
57 class="pf-v6-svg"
58 fill="currentColor"
59 viewBox="0 0 32 32"
60 aria-hidden="true"
61 role="img"
62 width="1em"
63 height="1em"
64 >
65 <path
66 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
67 />
68 </svg>
69 </div>
70 <p class="pf-v6-c-alert__title">
71 <span class="pf-v6-screen-reader">Success alert:</span>
72 Success alert title
73 </p>
74 </div>
75 <br />
76 <div class="pf-v6-c-alert pf-m-warning" aria-label="Warning alert">
77 <div class="pf-v6-c-alert__icon">
78 <svg
79 class="pf-v6-svg"
80 fill="currentColor"
81 viewBox="0 0 32 32"
82 aria-hidden="true"
83 role="img"
84 width="1em"
85 height="1em"
86 >
87 <path
88 d="m31.874 28.514-15.011-27a1.001 1.001 0 0 0-1.748 0l-15.011 27A1 1 0 0 0 .978 30H31a1 1 0 0 0 .874-1.486ZM14.5 12a1.5 1.5 0 0 1 3 0v5a1.5 1.5 0 0 1-3 0v-5ZM16 26.001a2 2 0 1 1-.001-3.999A2 2 0 0 1 16 26.001Z"
89 />
90 </svg>
91 </div>
92 <p class="pf-v6-c-alert__title">
93 <span class="pf-v6-screen-reader">Warning alert:</span>
94 Warning alert title
95 </p>
96 </div>
97 <br />
98 <div class="pf-v6-c-alert pf-m-danger" aria-label="Danger alert">
99 <div class="pf-v6-c-alert__icon">
100 <svg
101 class="pf-v6-svg"
102 fill="currentColor"
103 viewBox="0 0 32 32"
104 aria-hidden="true"
105 role="img"
106 width="1em"
107 height="1em"
108 >
109 <path
110 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm-1.5 8a1.5 1.5 0 1 1 3 0v7a1.5 1.5 0 1 1-3 0V9ZM16 25.001a2 2 0 1 1-.001-3.999A2 2 0 0 1 16 25.001Z"
111 />
112 </svg>
113 </div>
114 <p class="pf-v6-c-alert__title">
115 <span class="pf-v6-screen-reader">Danger alert:</span>
116 Danger alert title
117 </p>
118 </div>
119
120 ```
121
122 ### Variations
123
124 ```html
125 <div class="pf-v6-c-alert pf-m-success" aria-label="Success alert">
126 <div class="pf-v6-c-alert__icon">
127 <svg
128 class="pf-v6-svg"
129 fill="currentColor"
130 viewBox="0 0 32 32"
131 aria-hidden="true"
132 role="img"
133 width="1em"
134 height="1em"
135 >
136 <path
137 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
138 />
139 </svg>
140 </div>
141 <p class="pf-v6-c-alert__title">
142 <span class="pf-v6-screen-reader">Success alert:</span>
143 Success alert title
144 </p>
145 <div class="pf-v6-c-alert__action">
146 <button
147 class="pf-v6-c-button pf-m-plain"
148 type="button"
149 aria-label="Close success alert: Success alert title"
150 >
151 <span class="pf-v6-c-button__icon">
152 <svg
153 class="pf-v6-svg"
154 fill="currentColor"
155 viewBox="0 0 20 20"
156 aria-hidden="true"
157 role="img"
158 width="1em"
159 height="1em"
160 >
161 <path
162 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
163 />
164 </svg>
165 </span>
166 </button>
167 </div>
168 <div class="pf-v6-c-alert__description">
169 <p>Success alert description. This should tell the user more information about the alert.</p>
170 </div>
171 <div class="pf-v6-c-alert__action-group">
172 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
173 <span class="pf-v6-c-button__text">View details</span>
174 </button>
175 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
176 <span class="pf-v6-c-button__text">Ignore</span>
177 </button>
178 </div>
179 </div>
180 <br />
181 <div class="pf-v6-c-alert pf-m-success" aria-label="Success alert">
182 <div class="pf-v6-c-alert__icon">
183 <svg
184 class="pf-v6-svg"
185 fill="currentColor"
186 viewBox="0 0 32 32"
187 aria-hidden="true"
188 role="img"
189 width="1em"
190 height="1em"
191 >
192 <path
193 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
194 />
195 </svg>
196 </div>
197 <p class="pf-v6-c-alert__title">
198 <span class="pf-v6-screen-reader">Success alert:</span>
199 Success alert title
200 </p>
201 <div class="pf-v6-c-alert__action">
202 <button
203 class="pf-v6-c-button pf-m-plain"
204 type="button"
205 aria-label="Close success alert: Success alert title"
206 >
207 <span class="pf-v6-c-button__icon">
208 <svg
209 class="pf-v6-svg"
210 fill="currentColor"
211 viewBox="0 0 20 20"
212 aria-hidden="true"
213 role="img"
214 width="1em"
215 height="1em"
216 >
217 <path
218 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
219 />
220 </svg>
221 </span>
222 </button>
223 </div>
224 <div class="pf-v6-c-alert__description">
225 <p>
226 Success alert description. This should tell the user more information about the alert.
227 <a href="#">This is a link.</a>
228 </p>
229 </div>
230 </div>
231 <br />
232 <div class="pf-v6-c-alert pf-m-success" aria-label="Success alert">
233 <div class="pf-v6-c-alert__icon">
234 <svg
235 class="pf-v6-svg"
236 fill="currentColor"
237 viewBox="0 0 32 32"
238 aria-hidden="true"
239 role="img"
240 width="1em"
241 height="1em"
242 >
243 <path
244 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
245 />
246 </svg>
247 </div>
248 <p class="pf-v6-c-alert__title">
249 <span class="pf-v6-screen-reader">Success alert:</span>
250 Success alert title
251 </p>
252 <div class="pf-v6-c-alert__action">
253 <button
254 class="pf-v6-c-button pf-m-plain"
255 type="button"
256 aria-label="Close success alert: Success alert title"
257 >
258 <span class="pf-v6-c-button__icon">
259 <svg
260 class="pf-v6-svg"
261 fill="currentColor"
262 viewBox="0 0 20 20"
263 aria-hidden="true"
264 role="img"
265 width="1em"
266 height="1em"
267 >
268 <path
269 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
270 />
271 </svg>
272 </span>
273 </button>
274 </div>
275 <div class="pf-v6-c-alert__action-group">
276 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
277 <span class="pf-v6-c-button__text">View details</span>
278 </button>
279 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
280 <span class="pf-v6-c-button__text">Ignore</span>
281 </button>
282 </div>
283 </div>
284 <br />
285 <div class="pf-v6-c-alert pf-m-success" aria-label="Success alert">
286 <div class="pf-v6-c-alert__icon">
287 <svg
288 class="pf-v6-svg"
289 fill="currentColor"
290 viewBox="0 0 32 32"
291 aria-hidden="true"
292 role="img"
293 width="1em"
294 height="1em"
295 >
296 <path
297 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
298 />
299 </svg>
300 </div>
301 <p class="pf-v6-c-alert__title">
302 <span class="pf-v6-screen-reader">Success alert:</span>
303 Success alert title
304 </p>
305 <div class="pf-v6-c-alert__action">
306 <button
307 class="pf-v6-c-button pf-m-plain"
308 type="button"
309 aria-label="Close success alert: Success alert title"
310 >
311 <span class="pf-v6-c-button__icon">
312 <svg
313 class="pf-v6-svg"
314 fill="currentColor"
315 viewBox="0 0 20 20"
316 aria-hidden="true"
317 role="img"
318 width="1em"
319 height="1em"
320 >
321 <path
322 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
323 />
324 </svg>
325 </span>
326 </button>
327 </div>
328 </div>
329 <br />
330 <div class="pf-v6-c-alert pf-m-success" aria-label="Success alert">
331 <div class="pf-v6-c-alert__icon">
332 <svg
333 class="pf-v6-svg"
334 fill="currentColor"
335 viewBox="0 0 32 32"
336 aria-hidden="true"
337 role="img"
338 width="1em"
339 height="1em"
340 >
341 <path
342 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
343 />
344 </svg>
345 </div>
346 <p class="pf-v6-c-alert__title">
347 <span class="pf-v6-screen-reader">Success alert:</span>
348 Success alert title
349 </p>
350 </div>
351 <br />
352 <div
353 class="pf-v6-c-alert pf-m-success"
354 aria-label="Success alert with title truncation"
355 >
356 <div class="pf-v6-c-alert__icon">
357 <svg
358 class="pf-v6-svg"
359 fill="currentColor"
360 viewBox="0 0 32 32"
361 aria-hidden="true"
362 role="img"
363 width="1em"
364 height="1em"
365 >
366 <path
367 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
368 />
369 </svg>
370 </div>
371 <p class="pf-v6-c-alert__title pf-m-truncate">
372 <span class="pf-v6-screen-reader">Success alert:</span>
373 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pellentesque neque cursus enim fringilla tincidunt. Proin lobortis aliquam dictum. Nam vel ullamcorper nulla, nec blandit dolor. Vivamus pellentesque neque justo, nec accumsan nulla rhoncus id. Suspendisse mollis, tortor quis faucibus volutpat, sem leo fringilla turpis, ac lacinia augue metus in nulla. Cras vestibulum lacinia orci. Pellentesque sodales consequat interdum. Sed porttitor tincidunt metus nec iaculis. Pellentesque non commodo justo. Morbi feugiat rhoncus neque, vitae facilisis diam aliquam nec. Sed dapibus vitae quam at tristique. Nunc vel commodo mi. Mauris et rhoncus leo.
374 </p>
375 <div class="pf-v6-c-alert__description">
376 <p>This example uses ".pf-m-truncate" to limit the title to a single line and truncate any overflow text with ellipses.</p>
377 </div>
378 </div>
379 <br />
380 <div
381 class="pf-v6-c-alert pf-m-success"
382 aria-label="Success alert with title truncation at 2 lines"
383 >
384 <div class="pf-v6-c-alert__icon">
385 <svg
386 class="pf-v6-svg"
387 fill="currentColor"
388 viewBox="0 0 32 32"
389 aria-hidden="true"
390 role="img"
391 width="1em"
392 height="1em"
393 >
394 <path
395 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
396 />
397 </svg>
398 </div>
399 <p
400 class="pf-v6-c-alert__title pf-m-truncate"
401 style="--pf-v6-c-alert__title--max-lines: 2"
402 >
403 <span class="pf-v6-screen-reader">Success alert:</span>
404 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pellentesque neque cursus enim fringilla tincidunt. Proin lobortis aliquam dictum. Nam vel ullamcorper nulla, nec blandit dolor. Vivamus pellentesque neque justo, nec accumsan nulla rhoncus id. Suspendisse mollis, tortor quis faucibus volutpat, sem leo fringilla turpis, ac lacinia augue metus in nulla. Cras vestibulum lacinia orci. Pellentesque sodales consequat interdum. Sed porttitor tincidunt metus nec iaculis. Pellentesque non commodo justo. Morbi feugiat rhoncus neque, vitae facilisis diam aliquam nec. Sed dapibus vitae quam at tristique. Nunc vel commodo mi. Mauris et rhoncus leo.
405 </p>
406 <div class="pf-v6-c-alert__description">
407 <p>This example uses ".pf-m-truncate" and sets "--pf-v6-c-alert__title--max-lines: 2" to limit title to two lines and truncate any overflow text with ellipses.</p>
408 </div>
409 </div>
410
411 ```
412
413 ### Inline types
414
415 ```html
416 <div
417 class="pf-v6-c-alert pf-m-custom pf-m-inline"
418 aria-label="Inline custom alert"
419 >
420 <div class="pf-v6-c-alert__icon">
421 <svg
422 class="pf-v6-svg"
423 fill="currentColor"
424 viewBox="0 0 32 32"
425 aria-hidden="true"
426 role="img"
427 width="1em"
428 height="1em"
429 >
430 <path
431 d="M28.75 22v3.5c0 .689-.561 1.25-1.25 1.25h-7.521c.005.084.021.166.021.25 0 2.206-1.794 4-4 4s-4-1.794-4-4c0-.084.016-.166.021-.25H4.5c-.689 0-1.25-.561-1.25-1.25V22a.75.75 0 0 1 .75-.75c1.24 0 2.25-1.009 2.25-2.25v-4c0-4.826 3.528-8.833 8.138-9.605A2.482 2.482 0 0 1 13.5 3.5C13.5 2.122 14.621 1 16 1s2.5 1.122 2.5 2.5c0 .761-.349 1.436-.888 1.895 4.61.772 8.138 4.779 8.138 9.605v4c0 1.241 1.01 2.25 2.25 2.25a.75.75 0 0 1 .75.75Z"
432 />
433 </svg>
434 </div>
435 <p class="pf-v6-c-alert__title">
436 <span class="pf-v6-screen-reader">Custom inline alert:</span>
437 Custom inline alert title
438 </p>
439 </div>
440 <br />
441 <div
442 class="pf-v6-c-alert pf-m-info pf-m-inline"
443 aria-label="Inline information alert"
444 >
445 <div class="pf-v6-c-alert__icon">
446 <svg
447 class="pf-v6-svg"
448 fill="currentColor"
449 viewBox="0 0 32 32"
450 aria-hidden="true"
451 role="img"
452 width="1em"
453 height="1em"
454 >
455 <path
456 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm1.5 22a1.5 1.5 0 1 1-3 0v-5.157l-.188.04a1.5 1.5 0 0 1-.625-2.934l1.956-.416c.112-.024.223-.032.333-.03l.024-.002a1.5 1.5 0 0 1 1.5 1.5v7Zm-.08-12.58c-.38.37-.89.58-1.42.58a1.998 1.998 0 0 1-1.851-2.76c.051-.13.11-.24.19-.35.07-.11.15-.21.25-.3.74-.75 2.08-.75 2.83 0 .09.09.17.19.24.3.08.11.14.22.189.35.05.12.09.24.11.37.03.13.04.26.04.39 0 .53-.21 1.04-.58 1.42Z"
457 />
458 </svg>
459 </div>
460 <p class="pf-v6-c-alert__title">
461 <span class="pf-v6-screen-reader">Info alert:</span>
462 Info inline alert title
463 </p>
464 </div>
465 <br />
466 <div
467 class="pf-v6-c-alert pf-m-success pf-m-inline"
468 aria-label="Inline success alert"
469 >
470 <div class="pf-v6-c-alert__icon">
471 <svg
472 class="pf-v6-svg"
473 fill="currentColor"
474 viewBox="0 0 32 32"
475 aria-hidden="true"
476 role="img"
477 width="1em"
478 height="1em"
479 >
480 <path
481 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
482 />
483 </svg>
484 </div>
485 <p class="pf-v6-c-alert__title">
486 <span class="pf-v6-screen-reader">Success alert:</span>
487 Success inline alert title
488 </p>
489 </div>
490 <br />
491 <div
492 class="pf-v6-c-alert pf-m-warning pf-m-inline"
493 aria-label="Inline warning alert"
494 >
495 <div class="pf-v6-c-alert__icon">
496 <svg
497 class="pf-v6-svg"
498 fill="currentColor"
499 viewBox="0 0 32 32"
500 aria-hidden="true"
501 role="img"
502 width="1em"
503 height="1em"
504 >
505 <path
506 d="m31.874 28.514-15.011-27a1.001 1.001 0 0 0-1.748 0l-15.011 27A1 1 0 0 0 .978 30H31a1 1 0 0 0 .874-1.486ZM14.5 12a1.5 1.5 0 0 1 3 0v5a1.5 1.5 0 0 1-3 0v-5ZM16 26.001a2 2 0 1 1-.001-3.999A2 2 0 0 1 16 26.001Z"
507 />
508 </svg>
509 </div>
510 <p class="pf-v6-c-alert__title">
511 <span class="pf-v6-screen-reader">Warning alert:</span>
512 Warning inline alert title
513 </p>
514 </div>
515 <br />
516 <div
517 class="pf-v6-c-alert pf-m-danger pf-m-inline"
518 aria-label="Inline danger alert"
519 >
520 <div class="pf-v6-c-alert__icon">
521 <svg
522 class="pf-v6-svg"
523 fill="currentColor"
524 viewBox="0 0 32 32"
525 aria-hidden="true"
526 role="img"
527 width="1em"
528 height="1em"
529 >
530 <path
531 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm-1.5 8a1.5 1.5 0 1 1 3 0v7a1.5 1.5 0 1 1-3 0V9ZM16 25.001a2 2 0 1 1-.001-3.999A2 2 0 0 1 16 25.001Z"
532 />
533 </svg>
534 </div>
535 <p class="pf-v6-c-alert__title">
536 <span class="pf-v6-screen-reader">Danger alert:</span>
537 Danger inline alert title
538 </p>
539 </div>
540
541 ```
542
543 ### Inline variations
544
545 ```html
546 <div class="pf-v6-c-alert pf-m-success pf-m-inline" aria-label="Success alert">
547 <div class="pf-v6-c-alert__icon">
548 <svg
549 class="pf-v6-svg"
550 fill="currentColor"
551 viewBox="0 0 32 32"
552 aria-hidden="true"
553 role="img"
554 width="1em"
555 height="1em"
556 >
557 <path
558 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
559 />
560 </svg>
561 </div>
562 <p class="pf-v6-c-alert__title">
563 <span class="pf-v6-screen-reader">Success alert:</span>
564 Success alert title
565 </p>
566 <div class="pf-v6-c-alert__action">
567 <button
568 class="pf-v6-c-button pf-m-plain"
569 type="button"
570 aria-label="Close success alert: Success alert title"
571 >
572 <span class="pf-v6-c-button__icon">
573 <svg
574 class="pf-v6-svg"
575 fill="currentColor"
576 viewBox="0 0 20 20"
577 aria-hidden="true"
578 role="img"
579 width="1em"
580 height="1em"
581 >
582 <path
583 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
584 />
585 </svg>
586 </span>
587 </button>
588 </div>
589 <div class="pf-v6-c-alert__description">
590 <p>Success alert description. This should tell the user more information about the alert.</p>
591 </div>
592 <div class="pf-v6-c-alert__action-group">
593 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
594 <span class="pf-v6-c-button__text">View details</span>
595 </button>
596 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
597 <span class="pf-v6-c-button__text">Ignore</span>
598 </button>
599 </div>
600 </div>
601 <br />
602 <div class="pf-v6-c-alert pf-m-success pf-m-inline" aria-label="Success alert">
603 <div class="pf-v6-c-alert__icon">
604 <svg
605 class="pf-v6-svg"
606 fill="currentColor"
607 viewBox="0 0 32 32"
608 aria-hidden="true"
609 role="img"
610 width="1em"
611 height="1em"
612 >
613 <path
614 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
615 />
616 </svg>
617 </div>
618 <p class="pf-v6-c-alert__title">
619 <span class="pf-v6-screen-reader">Success alert:</span>
620 Success alert title
621 </p>
622 <div class="pf-v6-c-alert__action">
623 <button
624 class="pf-v6-c-button pf-m-plain"
625 type="button"
626 aria-label="Close success alert: Success alert title"
627 >
628 <span class="pf-v6-c-button__icon">
629 <svg
630 class="pf-v6-svg"
631 fill="currentColor"
632 viewBox="0 0 20 20"
633 aria-hidden="true"
634 role="img"
635 width="1em"
636 height="1em"
637 >
638 <path
639 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
640 />
641 </svg>
642 </span>
643 </button>
644 </div>
645 <div class="pf-v6-c-alert__description">
646 <p>
647 Success alert description. This should tell the user more information about the alert.
648 <a href="#">This is a link.</a>
649 </p>
650 </div>
651 </div>
652 <br />
653 <div class="pf-v6-c-alert pf-m-success pf-m-inline" aria-label="Success alert">
654 <div class="pf-v6-c-alert__icon">
655 <svg
656 class="pf-v6-svg"
657 fill="currentColor"
658 viewBox="0 0 32 32"
659 aria-hidden="true"
660 role="img"
661 width="1em"
662 height="1em"
663 >
664 <path
665 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
666 />
667 </svg>
668 </div>
669 <p class="pf-v6-c-alert__title">
670 <span class="pf-v6-screen-reader">Success alert:</span>
671 Success alert title
672 </p>
673 <div class="pf-v6-c-alert__action">
674 <button
675 class="pf-v6-c-button pf-m-plain"
676 type="button"
677 aria-label="Close success alert: Success alert title"
678 >
679 <span class="pf-v6-c-button__icon">
680 <svg
681 class="pf-v6-svg"
682 fill="currentColor"
683 viewBox="0 0 20 20"
684 aria-hidden="true"
685 role="img"
686 width="1em"
687 height="1em"
688 >
689 <path
690 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
691 />
692 </svg>
693 </span>
694 </button>
695 </div>
696 <div class="pf-v6-c-alert__action-group">
697 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
698 <span class="pf-v6-c-button__text">View details</span>
699 </button>
700 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
701 <span class="pf-v6-c-button__text">Ignore</span>
702 </button>
703 </div>
704 </div>
705 <br />
706 <div class="pf-v6-c-alert pf-m-success pf-m-inline" aria-label="Success alert">
707 <div class="pf-v6-c-alert__icon">
708 <svg
709 class="pf-v6-svg"
710 fill="currentColor"
711 viewBox="0 0 32 32"
712 aria-hidden="true"
713 role="img"
714 width="1em"
715 height="1em"
716 >
717 <path
718 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
719 />
720 </svg>
721 </div>
722 <p class="pf-v6-c-alert__title">
723 <span class="pf-v6-screen-reader">Success alert:</span>
724 Success alert title
725 </p>
726 </div>
727
728 ```
729
730 ### Custom icon
731
732 ```html
733 <div class="pf-v6-c-alert pf-m-success" aria-label="Success alert">
734 <div class="pf-v6-c-alert__icon">
735 <svg
736 class="pf-v6-svg"
737 fill="currentColor"
738 viewBox="0 0 32 32"
739 aria-hidden="true"
740 role="img"
741 width="1em"
742 height="1em"
743 >
744 <path
745 d="M26.463 16.845a9.635 9.635 0 0 0-.002-1.688l3.41-1.974a.5.5 0 0 0 .235-.548 14.47 14.47 0 0 0-4.142-7.167.5.5 0 0 0-.594-.07l-3.404 1.97c-.469-.326-.96-.61-1.466-.85V2.58a.5.5 0 0 0-.356-.48 14.662 14.662 0 0 0-8.288 0 .5.5 0 0 0-.356.48v3.944c-.513.245-1.003.528-1.462.846L6.63 5.397a.5.5 0 0 0-.594.07 14.47 14.47 0 0 0-4.142 7.168.5.5 0 0 0 .236.548l3.407 1.972a9.635 9.635 0 0 0 .002 1.688l-3.41 1.974a.5.5 0 0 0-.235.548 14.47 14.47 0 0 0 4.142 7.167c.16.154.405.18.594.07l3.404-1.97c.469.326.96.61 1.466.85v3.938a.5.5 0 0 0 .356.48c1.333.398 2.728.6 4.144.6s2.81-.202 4.144-.6a.5.5 0 0 0 .356-.48v-3.944a10.449 10.449 0 0 0 1.462-.846l3.408 1.973a.5.5 0 0 0 .594-.07 14.47 14.47 0 0 0 4.142-7.168.5.5 0 0 0-.236-.548l-3.407-1.972ZM16 21c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5Z"
746 />
747 </svg>
748 </div>
749 <p class="pf-v6-c-alert__title">
750 <span class="pf-v6-screen-reader">Success alert:</span>
751 Success alert title
752 </p>
753 </div>
754 <br />
755 <div class="pf-v6-c-alert pf-m-success pf-m-inline" aria-label="Success alert">
756 <div class="pf-v6-c-alert__icon">
757 <svg
758 class="pf-v6-svg"
759 fill="currentColor"
760 viewBox="0 0 32 32"
761 aria-hidden="true"
762 role="img"
763 width="1em"
764 height="1em"
765 >
766 <path
767 d="M26.463 16.845a9.635 9.635 0 0 0-.002-1.688l3.41-1.974a.5.5 0 0 0 .235-.548 14.47 14.47 0 0 0-4.142-7.167.5.5 0 0 0-.594-.07l-3.404 1.97c-.469-.326-.96-.61-1.466-.85V2.58a.5.5 0 0 0-.356-.48 14.662 14.662 0 0 0-8.288 0 .5.5 0 0 0-.356.48v3.944c-.513.245-1.003.528-1.462.846L6.63 5.397a.5.5 0 0 0-.594.07 14.47 14.47 0 0 0-4.142 7.168.5.5 0 0 0 .236.548l3.407 1.972a9.635 9.635 0 0 0 .002 1.688l-3.41 1.974a.5.5 0 0 0-.235.548 14.47 14.47 0 0 0 4.142 7.167c.16.154.405.18.594.07l3.404-1.97c.469.326.96.61 1.466.85v3.938a.5.5 0 0 0 .356.48c1.333.398 2.728.6 4.144.6s2.81-.202 4.144-.6a.5.5 0 0 0 .356-.48v-3.944a10.449 10.449 0 0 0 1.462-.846l3.408 1.973a.5.5 0 0 0 .594-.07 14.47 14.47 0 0 0 4.142-7.168.5.5 0 0 0-.236-.548l-3.407-1.972ZM16 21c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5Z"
768 />
769 </svg>
770 </div>
771 <p class="pf-v6-c-alert__title">
772 <span class="pf-v6-screen-reader">Success alert:</span>
773 Success alert title (inline)
774 </p>
775 </div>
776
777 ```
778
779 ### Inline plain
780
781 ```html
782 <div
783 class="pf-v6-c-alert pf-m-success pf-m-plain pf-m-inline"
784 aria-label="Success alert"
785 >
786 <div class="pf-v6-c-alert__icon">
787 <svg
788 class="pf-v6-svg"
789 fill="currentColor"
790 viewBox="0 0 32 32"
791 aria-hidden="true"
792 role="img"
793 width="1em"
794 height="1em"
795 >
796 <path
797 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
798 />
799 </svg>
800 </div>
801 <p class="pf-v6-c-alert__title">
802 <span class="pf-v6-screen-reader">Success alert:</span>
803 Success alert title
804 </p>
805 </div>
806
807 ```
808
809 ### Expandable
810
811 ```html
812 <div
813 class="pf-v6-c-alert pf-m-expandable pf-m-success"
814 aria-label="Success alert"
815 >
816 <div class="pf-v6-c-alert__toggle">
817 <button
818 class="pf-v6-c-button pf-m-plain"
819 id="alert-expandable-example-1-toggle"
820 type="button"
821 aria-expanded="false"
822 aria-labelledby="alert-expandable-example-1-title alert-expandable-example-1-toggle"
823 aria-label="Details"
824 >
825 <span class="pf-v6-c-button__icon">
826 <span class="pf-v6-c-alert__toggle-icon">
827 <svg
828 class="pf-v6-svg"
829 fill="currentColor"
830 viewBox="0 0 20 20"
831 aria-hidden="true"
832 role="img"
833 width="1em"
834 height="1em"
835 >
836 <path
837 d="M18.71 5.29a.996.996 0 0 0-1.41 0l-7.29 7.29-7.3-7.29a.987.987 0 0 0-1.41-.02.987.987 0 0 0-.02 1.41l.02.02 7.65 7.65c.29.29.68.44 1.06.44s.77-.15 1.06-.44l7.65-7.65a.996.996 0 0 0 0-1.41Z"
838 />
839 </svg>
840 </span>
841 </span>
842 </button>
843 </div>
844 <div class="pf-v6-c-alert__icon">
845 <svg
846 class="pf-v6-svg"
847 fill="currentColor"
848 viewBox="0 0 32 32"
849 aria-hidden="true"
850 role="img"
851 width="1em"
852 height="1em"
853 >
854 <path
855 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
856 />
857 </svg>
858 </div>
859 <p class="pf-v6-c-alert__title" id="alert-expandable-example-1-title">
860 <span class="pf-v6-screen-reader">Success alert:</span>
861 Success alert title
862 </p>
863 <div class="pf-v6-c-alert__action">
864 <button
865 class="pf-v6-c-button pf-m-plain"
866 type="button"
867 aria-label="Close success alert: Success alert title"
868 >
869 <span class="pf-v6-c-button__icon">
870 <svg
871 class="pf-v6-svg"
872 fill="currentColor"
873 viewBox="0 0 20 20"
874 aria-hidden="true"
875 role="img"
876 width="1em"
877 height="1em"
878 >
879 <path
880 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
881 />
882 </svg>
883 </span>
884 </button>
885 </div>
886 <div class="pf-v6-c-alert__description" hidden>
887 <p>Success alert description. This should tell the user more information about the alert.</p>
888 </div>
889 <div class="pf-v6-c-alert__action-group">
890 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
891 <span class="pf-v6-c-button__text">View details</span>
892 </button>
893 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
894 <span class="pf-v6-c-button__text">Ignore</span>
895 </button>
896 </div>
897 </div>
898 <br />
899 <div
900 class="pf-v6-c-alert pf-m-expandable pf-m-expanded pf-m-success"
901 aria-label="Success alert"
902 >
903 <div class="pf-v6-c-alert__toggle">
904 <button
905 class="pf-v6-c-button pf-m-plain"
906 id="alert-expandable-example-2-toggle"
907 type="button"
908 aria-expanded="true"
909 aria-labelledby="alert-expandable-example-2-title alert-expandable-example-2-toggle"
910 aria-label="Details"
911 >
912 <span class="pf-v6-c-button__icon">
913 <span class="pf-v6-c-alert__toggle-icon">
914 <svg
915 class="pf-v6-svg"
916 fill="currentColor"
917 viewBox="0 0 20 20"
918 aria-hidden="true"
919 role="img"
920 width="1em"
921 height="1em"
922 >
923 <path
924 d="M18.71 5.29a.996.996 0 0 0-1.41 0l-7.29 7.29-7.3-7.29a.987.987 0 0 0-1.41-.02.987.987 0 0 0-.02 1.41l.02.02 7.65 7.65c.29.29.68.44 1.06.44s.77-.15 1.06-.44l7.65-7.65a.996.996 0 0 0 0-1.41Z"
925 />
926 </svg>
927 </span>
928 </span>
929 </button>
930 </div>
931 <div class="pf-v6-c-alert__icon">
932 <svg
933 class="pf-v6-svg"
934 fill="currentColor"
935 viewBox="0 0 32 32"
936 aria-hidden="true"
937 role="img"
938 width="1em"
939 height="1em"
940 >
941 <path
942 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
943 />
944 </svg>
945 </div>
946 <p class="pf-v6-c-alert__title" id="alert-expandable-example-2-title">
947 <span class="pf-v6-screen-reader">Success alert:</span>
948 Success alert title (expanded)
949 </p>
950 <div class="pf-v6-c-alert__action">
951 <button
952 class="pf-v6-c-button pf-m-plain"
953 type="button"
954 aria-label="Close success alert: Success alert title"
955 >
956 <span class="pf-v6-c-button__icon">
957 <svg
958 class="pf-v6-svg"
959 fill="currentColor"
960 viewBox="0 0 20 20"
961 aria-hidden="true"
962 role="img"
963 width="1em"
964 height="1em"
965 >
966 <path
967 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
968 />
969 </svg>
970 </span>
971 </button>
972 </div>
973 <div class="pf-v6-c-alert__description">
974 <p>Success alert description. This should tell the user more information about the alert.</p>
975 </div>
976 <div class="pf-v6-c-alert__action-group">
977 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
978 <span class="pf-v6-c-button__text">View details</span>
979 </button>
980 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
981 <span class="pf-v6-c-button__text">Ignore</span>
982 </button>
983 </div>
984 </div>
985 <br />
986 <div
987 class="pf-v6-c-alert pf-m-expandable pf-m-success pf-m-inline"
988 aria-label="Success alert"
989 >
990 <div class="pf-v6-c-alert__toggle">
991 <button
992 class="pf-v6-c-button pf-m-plain"
993 id="alert-expandable-example-3-toggle"
994 type="button"
995 aria-expanded="false"
996 aria-labelledby="alert-expandable-example-3-title alert-expandable-example-3-toggle"
997 aria-label="Details"
998 >
999 <span class="pf-v6-c-button__icon">
1000 <span class="pf-v6-c-alert__toggle-icon">
1001 <svg
1002 class="pf-v6-svg"
1003 fill="currentColor"
1004 viewBox="0 0 20 20"
1005 aria-hidden="true"
1006 role="img"
1007 width="1em"
1008 height="1em"
1009 >
1010 <path
1011 d="M18.71 5.29a.996.996 0 0 0-1.41 0l-7.29 7.29-7.3-7.29a.987.987 0 0 0-1.41-.02.987.987 0 0 0-.02 1.41l.02.02 7.65 7.65c.29.29.68.44 1.06.44s.77-.15 1.06-.44l7.65-7.65a.996.996 0 0 0 0-1.41Z"
1012 />
1013 </svg>
1014 </span>
1015 </span>
1016 </button>
1017 </div>
1018 <div class="pf-v6-c-alert__icon">
1019 <svg
1020 class="pf-v6-svg"
1021 fill="currentColor"
1022 viewBox="0 0 32 32"
1023 aria-hidden="true"
1024 role="img"
1025 width="1em"
1026 height="1em"
1027 >
1028 <path
1029 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
1030 />
1031 </svg>
1032 </div>
1033 <p class="pf-v6-c-alert__title" id="alert-expandable-example-3-title">
1034 <span class="pf-v6-screen-reader">Success alert:</span>
1035 Success alert title
1036 </p>
1037 <div class="pf-v6-c-alert__action">
1038 <button
1039 class="pf-v6-c-button pf-m-plain"
1040 type="button"
1041 aria-label="Close success alert: Success alert title"
1042 >
1043 <span class="pf-v6-c-button__icon">
1044 <svg
1045 class="pf-v6-svg"
1046 fill="currentColor"
1047 viewBox="0 0 20 20"
1048 aria-hidden="true"
1049 role="img"
1050 width="1em"
1051 height="1em"
1052 >
1053 <path
1054 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
1055 />
1056 </svg>
1057 </span>
1058 </button>
1059 </div>
1060 <div class="pf-v6-c-alert__description" hidden>
1061 <p>Success alert description. This should tell the user more information about the alert.</p>
1062 </div>
1063 <div class="pf-v6-c-alert__action-group">
1064 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
1065 <span class="pf-v6-c-button__text">View details</span>
1066 </button>
1067 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
1068 <span class="pf-v6-c-button__text">Ignore</span>
1069 </button>
1070 </div>
1071 </div>
1072 <br />
1073 <div
1074 class="pf-v6-c-alert pf-m-expandable pf-m-expanded pf-m-success pf-m-inline"
1075 aria-label="Success alert"
1076 >
1077 <div class="pf-v6-c-alert__toggle">
1078 <button
1079 class="pf-v6-c-button pf-m-plain"
1080 id="alert-expandable-example-4-toggle"
1081 type="button"
1082 aria-expanded="true"
1083 aria-labelledby="alert-expandable-example-4-title alert-expandable-example-4-toggle"
1084 aria-label="Details"
1085 >
1086 <span class="pf-v6-c-button__icon">
1087 <span class="pf-v6-c-alert__toggle-icon">
1088 <svg
1089 class="pf-v6-svg"
1090 fill="currentColor"
1091 viewBox="0 0 20 20"
1092 aria-hidden="true"
1093 role="img"
1094 width="1em"
1095 height="1em"
1096 >
1097 <path
1098 d="M18.71 5.29a.996.996 0 0 0-1.41 0l-7.29 7.29-7.3-7.29a.987.987 0 0 0-1.41-.02.987.987 0 0 0-.02 1.41l.02.02 7.65 7.65c.29.29.68.44 1.06.44s.77-.15 1.06-.44l7.65-7.65a.996.996 0 0 0 0-1.41Z"
1099 />
1100 </svg>
1101 </span>
1102 </span>
1103 </button>
1104 </div>
1105 <div class="pf-v6-c-alert__icon">
1106 <svg
1107 class="pf-v6-svg"
1108 fill="currentColor"
1109 viewBox="0 0 32 32"
1110 aria-hidden="true"
1111 role="img"
1112 width="1em"
1113 height="1em"
1114 >
1115 <path
1116 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
1117 />
1118 </svg>
1119 </div>
1120 <p class="pf-v6-c-alert__title" id="alert-expandable-example-4-title">
1121 <span class="pf-v6-screen-reader">Success alert:</span>
1122 Success alert title (expanded)
1123 </p>
1124 <div class="pf-v6-c-alert__action">
1125 <button
1126 class="pf-v6-c-button pf-m-plain"
1127 type="button"
1128 aria-label="Close success alert: Success alert title"
1129 >
1130 <span class="pf-v6-c-button__icon">
1131 <svg
1132 class="pf-v6-svg"
1133 fill="currentColor"
1134 viewBox="0 0 20 20"
1135 aria-hidden="true"
1136 role="img"
1137 width="1em"
1138 height="1em"
1139 >
1140 <path
1141 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
1142 />
1143 </svg>
1144 </span>
1145 </button>
1146 </div>
1147 <div class="pf-v6-c-alert__description">
1148 <p>Success alert description. This should tell the user more information about the alert.</p>
1149 </div>
1150 <div class="pf-v6-c-alert__action-group">
1151 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
1152 <span class="pf-v6-c-button__text">View details</span>
1153 </button>
1154 <button class="pf-v6-c-button pf-m-inline pf-m-link" type="button">
1155 <span class="pf-v6-c-button__text">Ignore</span>
1156 </button>
1157 </div>
1158 </div>
1159
1160 ```
1161
1162 ## Alert group examples
1163
1164 ### Static alert group
1165
1166 An alert group is optional when only one static alert is needed. It becomes required when more than one alert is used in a list.
1167
1168 ```html
1169 <ul class="pf-v6-c-alert-group" role="list">
1170 <li class="pf-v6-c-alert-group__item">
1171 <div
1172 class="pf-v6-c-alert pf-m-inline pf-m-success"
1173 aria-label="Success alert"
1174 >
1175 <div class="pf-v6-c-alert__icon">
1176 <svg
1177 class="pf-v6-svg"
1178 fill="currentColor"
1179 viewBox="0 0 32 32"
1180 aria-hidden="true"
1181 role="img"
1182 width="1em"
1183 height="1em"
1184 >
1185 <path
1186 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
1187 />
1188 </svg>
1189 </div>
1190 <p class="pf-v6-c-alert__title">
1191 <span class="pf-v6-screen-reader">Success alert:</span>
1192 Success alert title
1193 </p>
1194 </div>
1195 </li>
1196
1197 <li class="pf-v6-c-alert-group__item">
1198 <div
1199 class="pf-v6-c-alert pf-m-inline pf-m-danger"
1200 aria-label="Danger alert"
1201 >
1202 <div class="pf-v6-c-alert__icon">
1203 <svg
1204 class="pf-v6-svg"
1205 fill="currentColor"
1206 viewBox="0 0 32 32"
1207 aria-hidden="true"
1208 role="img"
1209 width="1em"
1210 height="1em"
1211 >
1212 <path
1213 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm-1.5 8a1.5 1.5 0 1 1 3 0v7a1.5 1.5 0 1 1-3 0V9ZM16 25.001a2 2 0 1 1-.001-3.999A2 2 0 0 1 16 25.001Z"
1214 />
1215 </svg>
1216 </div>
1217 <p class="pf-v6-c-alert__title">
1218 <span class="pf-v6-screen-reader">Danger alert:</span>
1219 Danger alert title
1220 </p>
1221 </div>
1222 </li>
1223
1224 <li class="pf-v6-c-alert-group__item">
1225 <div
1226 class="pf-v6-c-alert pf-m-inline pf-m-info"
1227 aria-label="Information alert"
1228 >
1229 <div class="pf-v6-c-alert__icon">
1230 <svg
1231 class="pf-v6-svg"
1232 fill="currentColor"
1233 viewBox="0 0 32 32"
1234 aria-hidden="true"
1235 role="img"
1236 width="1em"
1237 height="1em"
1238 >
1239 <path
1240 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm1.5 22a1.5 1.5 0 1 1-3 0v-5.157l-.188.04a1.5 1.5 0 0 1-.625-2.934l1.956-.416c.112-.024.223-.032.333-.03l.024-.002a1.5 1.5 0 0 1 1.5 1.5v7Zm-.08-12.58c-.38.37-.89.58-1.42.58a1.998 1.998 0 0 1-1.851-2.76c.051-.13.11-.24.19-.35.07-.11.15-.21.25-.3.74-.75 2.08-.75 2.83 0 .09.09.17.19.24.3.08.11.14.22.189.35.05.12.09.24.11.37.03.13.04.26.04.39 0 .53-.21 1.04-.58 1.42Z"
1241 />
1242 </svg>
1243 </div>
1244 <p class="pf-v6-c-alert__title">
1245 <span class="pf-v6-screen-reader">Info alert:</span>
1246 Info alert title
1247 </p>
1248 <div class="pf-v6-c-alert__description">
1249 <p>
1250 Info alert description.
1251 <a href="#">This is a link.</a>
1252 </p>
1253 </div>
1254 </div>
1255 </li>
1256 </ul>
1257
1258 ```
1259
1260 ### Toast alert group
1261
1262 An alert group is required to display toast alerts. An alert group that includes the `.pf-m-toast` modifier becomes a toast alert group with unique positioning in the top-right corner of the window.
1263
1264 Every toast alert must include a close button to dismiss the alert.
1265
1266 When toast alerts include a link or action, these elements are not announced as interactive elements by screen readers. Whenever you include a link or button, incorporate it into the message so that it’s clear to the user how to access the same contents or action without clicking the link or button directly in the toast. For example, if your toast alert displays a message “The build is complete. Go to the Builds page to download,” the screen reader user is given instructions on how to find their build for download.
1267
1268 For sighted users, interactive elements can be included in this message in one of the following ways:
1269
1270 * Using a link to the Builds page: "The build is complete. Go to the [Builds](#) page to download" using `<a href="#">Builds</a>`
1271 * Using a button to download: "The build is complete. Go to the Builds page to <button class="pf-v6-c-button pf-m-link pf-m-inline" type="button">download</button>" using `<button class="pf-v6-c-button pf-m-link pf-m-inline type="button">download</button>`
1272
1273 ```html isFullscreen
1274 <ul class="pf-v6-c-alert-group pf-m-toast" role="list">
1275 <li class="pf-v6-c-alert-group__item">
1276 <div class="pf-v6-c-alert pf-m-success" aria-label="Success toast alert">
1277 <div class="pf-v6-c-alert__icon">
1278 <svg
1279 class="pf-v6-svg"
1280 fill="currentColor"
1281 viewBox="0 0 32 32"
1282 aria-hidden="true"
1283 role="img"
1284 width="1em"
1285 height="1em"
1286 >
1287 <path
1288 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm7.795 11.795-8.646 8.646c-.317.317-.733.475-1.149.475s-.832-.158-1.149-.475l-4.646-4.646a1.126 1.126 0 0 1 1.591-1.591l4.205 4.205 8.205-8.205a1.126 1.126 0 0 1 1.591 1.591Z"
1289 />
1290 </svg>
1291 </div>
1292 <p class="pf-v6-c-alert__title" id="alert_one_title">
1293 <span class="pf-v6-screen-reader">Success alert:</span>
1294 Success toast alert title
1295 </p>
1296 <div class="pf-v6-c-alert__description">
1297 <p>
1298 Info toast alert description. From the settings tab, click
1299 <a href="#">View logs</a>&nbsp;to review the details.
1300 </p>
1301 </div>
1302 <div class="pf-v6-c-alert__action">
1303 <button
1304 class="pf-v6-c-button pf-m-plain"
1305 type="button"
1306 aria-label="Close success alert: Success alert title"
1307 >
1308 <span class="pf-v6-c-button__icon">
1309 <svg
1310 class="pf-v6-svg"
1311 fill="currentColor"
1312 viewBox="0 0 20 20"
1313 aria-hidden="true"
1314 role="img"
1315 width="1em"
1316 height="1em"
1317 >
1318 <path
1319 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
1320 />
1321 </svg>
1322 </span>
1323 </button>
1324 </div>
1325 </div>
1326 </li>
1327
1328 <li class="pf-v6-c-alert-group__item">
1329 <div class="pf-v6-c-alert pf-m-danger" aria-label="Danger toast alert">
1330 <div class="pf-v6-c-alert__icon">
1331 <svg
1332 class="pf-v6-svg"
1333 fill="currentColor"
1334 viewBox="0 0 32 32"
1335 aria-hidden="true"
1336 role="img"
1337 width="1em"
1338 height="1em"
1339 >
1340 <path
1341 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm-1.5 8a1.5 1.5 0 1 1 3 0v7a1.5 1.5 0 1 1-3 0V9ZM16 25.001a2 2 0 1 1-.001-3.999A2 2 0 0 1 16 25.001Z"
1342 />
1343 </svg>
1344 </div>
1345 <p class="pf-v6-c-alert__title" id="alert_two_title">
1346 <span class="pf-v6-screen-reader">Danger alert:</span>
1347 Danger toast alert title
1348 </p>
1349 <div class="pf-v6-c-alert__action">
1350 <button
1351 class="pf-v6-c-button pf-m-plain"
1352 type="button"
1353 aria-label="Close danger alert: Danger alert title"
1354 >
1355 <span class="pf-v6-c-button__icon">
1356 <svg
1357 class="pf-v6-svg"
1358 fill="currentColor"
1359 viewBox="0 0 20 20"
1360 aria-hidden="true"
1361 role="img"
1362 width="1em"
1363 height="1em"
1364 >
1365 <path
1366 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
1367 />
1368 </svg>
1369 </span>
1370 </button>
1371 </div>
1372 </div>
1373 </li>
1374
1375 <li class="pf-v6-c-alert-group__item">
1376 <div class="pf-v6-c-alert pf-m-info" aria-label="Information toast alert">
1377 <div class="pf-v6-c-alert__icon">
1378 <svg
1379 class="pf-v6-svg"
1380 fill="currentColor"
1381 viewBox="0 0 32 32"
1382 aria-hidden="true"
1383 role="img"
1384 width="1em"
1385 height="1em"
1386 >
1387 <path
1388 d="M16 1C7.729 1 1 7.729 1 16s6.729 15 15 15 15-6.729 15-15S24.271 1 16 1Zm1.5 22a1.5 1.5 0 1 1-3 0v-5.157l-.188.04a1.5 1.5 0 0 1-.625-2.934l1.956-.416c.112-.024.223-.032.333-.03l.024-.002a1.5 1.5 0 0 1 1.5 1.5v7Zm-.08-12.58c-.38.37-.89.58-1.42.58a1.998 1.998 0 0 1-1.851-2.76c.051-.13.11-.24.19-.35.07-.11.15-.21.25-.3.74-.75 2.08-.75 2.83 0 .09.09.17.19.24.3.08.11.14.22.189.35.05.12.09.24.11.37.03.13.04.26.04.39 0 .53-.21 1.04-.58 1.42Z"
1389 />
1390 </svg>
1391 </div>
1392 <p class="pf-v6-c-alert__title" id="alert_three_title">
1393 <span class="pf-v6-screen-reader">Info alert:</span>
1394 Info toast alert title
1395 </p>
1396 <div class="pf-v6-c-alert__description">
1397 <p>
1398 Info toast alert description. From the settings tab, click
1399 <a href="#">View logs</a>&nbsp;to review the details.
1400 </p>
1401 </div>
1402 <div class="pf-v6-c-alert__action">
1403 <button
1404 class="pf-v6-c-button pf-m-plain"
1405 type="button"
1406 aria-label="Close info alert: Info alert title"
1407 >
1408 <span class="pf-v6-c-button__icon">
1409 <svg
1410 class="pf-v6-svg"
1411 fill="currentColor"
1412 viewBox="0 0 20 20"
1413 aria-hidden="true"
1414 role="img"
1415 width="1em"
1416 height="1em"
1417 >
1418 <path
1419 d="M17.8 16.2 11.59 10l6.21-6.21c.42-.46.39-1.17-.07-1.59-.43-.4-1.09-.4-1.52 0l-6.2 6.2-6.22-6.19c-.44-.44-1.15-.44-1.59 0-.44.44-.44 1.15 0 1.59l6.2 6.21-6.2 6.2c-.42.46-.39 1.17.07 1.59.43.4 1.09.4 1.52 0L10 11.59l6.2 6.2c.44.44 1.15.44 1.59 0 .44-.45.44-1.16 0-1.6Z"
1420 />
1421 </svg>
1422 </span>
1423 </button>
1424 </div>
1425 </div>
1426 </li>
1427 <li>
1428 <button
1429 class="pf-v6-c-alert-group__overflow-button"
1430 >View 3 more notifications</button>
1431 </li>
1432 </ul>
1433
1434 ```
1435
1436 ## Documentation
1437
1438 ### Alert overview
1439
1440 Add a modifier class to the default alert to change the color: `.pf-m-success`, `.pf-m-danger`, `.pf-m-warning`, or `.pf-m-info`.
1441
1442 ### Alert usage
1443
1444 | Class | Applied to | Outcome |
1445 | -- | -- | -- |
1446 | `.pf-v6-c-alert` | `<div>` | Initiates the alert component. Always use with a status modifier class. **Required** |
1447 | `.pf-v6-c-alert__toggle` | `<div>` | Defines the expandable alert toggle icon. **Required for expandable alerts** |
1448 | `.pf-v6-c-alert__toggle-icon` | `<span>` | Defines the expandable alert toggle icon. **Required for expandable alerts** |
1449 | `.pf-v6-c-alert__icon` | `<div>` | Defines the alert icon. **Required** |
1450 | `.pf-v6-c-alert__title` | `<p>, <h1-h6>` | Defines the alert title. **Required** |
1451 | `.pf-v6-c-alert__description` | `<div>` | Defines the alert description area. |
1452 | `.pf-v6-c-alert__action` | `<div>` | Defines the action button wrapper. Should contain `.pf-v6-c-button.pf-m-plain` for close action or `.pf-v6-c-button.pf-m-link` for link text. It should only include one action. |
1453 | `.pf-v6-c-alert__action-group` | `<div>` | Defines the action button group. Should contain `.pf-v6-c-button.pf-m-link.pf-m-inline` for inline link text. **Note:** only inline link buttons are supported in the alert action group. |
1454 | `.pf-m-custom` | `.pf-v6-c-alert` | Applies custom status styling. |
1455 | `.pf-m-success` | `.pf-v6-c-alert` | Applies success status styling. |
1456 | `.pf-m-danger` | `.pf-v6-c-alert` | Applies danger status styling. |
1457 | `.pf-m-warning` | `.pf-v6-c-alert` | Applies warning status styling. |
1458 | `.pf-m-info` | `.pf-v6-c-alert` | Applies info status styling. |
1459 | `.pf-m-inline` | `.pf-v6-c-alert` | Applies inline styling. |
1460 | `.pf-m-plain` | `.pf-v6-c-alert.pf-m-inline` | Applies plain styling to an inline alert. |
1461 | `.pf-m-expandable` | `.pf-v6-c-alert` | Applies expandable styles to the alert. |
1462 | `.pf-m-expanded` | `.pf-v6-c-alert.pf-m-expandable` | Applies expanded styles to an expandable alert. |
1463 | `.pf-m-truncate` | `.pf-v6-c-alert__title` | Modifies the title to display a single line and truncate any overflow text with ellipses. **Note:** you can specify the max number of lines to show by setting the `--pf-v6-c-alert__title--max-lines` (the default value is `1`). |
1464
1465 ### Alert group overview
1466
1467 The alert component is used to contain and align consecutive alerts. Alert groups can either be embedded alongside a page's content or in the top-right corner as a toast group using the `.pf-m-toast` modifier.
1468
1469 ### Alert group usage
1470
1471 | Class | Applied to | Outcome |
1472 | -- | -- | -- |
1473 | `.pf-v6-c-alert-group` | `<ul>` | Creates an alert group component. **Required** |
1474 | `.pf-v6-c-alert-group__item` | `<li>` | Creates an alert group item. **Required** |
1475 | `.pf-v6-c-alert-group__overflow-button` | `<button>` | Applies overflow button styling to an alert group overflow button. |
1476 | `.pf-m-toast`| `.pf-v6-c-alert-group` | Applies toast alert styling to an alert group. |