Debian Codegraph @

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

raw
1 ---
2 id: Empty state
3 section: components
4 cssPrefix: pf-v6-c-empty-state
5 ---## Examples
6
7 ### Basic
8
9 ```html
10 <div class="pf-v6-c-empty-state">
11 <div class="pf-v6-c-empty-state__content">
12 <div class="pf-v6-c-empty-state__header">
13 <div class="pf-v6-c-empty-state__icon">
14 <svg
15 class="pf-v6-svg"
16 fill="currentColor"
17 viewBox="0 0 512 512"
18 aria-hidden="true"
19 role="img"
20 width="1em"
21 height="1em"
22 >
23 <path
24 d="M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"
25 />
26 </svg>
27 </div>
28 <div class="pf-v6-c-empty-state__title">
29 <h4 class="pf-v6-c-empty-state__title-text">Empty state</h4>
30 </div>
31 </div>
32
33 <div
34 class="pf-v6-c-empty-state__body"
35 >This represents an the empty state pattern in PatternFly. Hopefully it's simple enough to use but flexible enough to meet a variety of needs.</div>
36
37 <div class="pf-v6-c-empty-state__footer">
38 <div class="pf-v6-c-empty-state__actions">
39 <button class="pf-v6-c-button pf-m-primary" type="button">
40 <span class="pf-v6-c-button__text">Primary action</span>
41 </button>
42 </div>
43 <div class="pf-v6-c-empty-state__actions">
44 <button class="pf-v6-c-button pf-m-link" type="button">
45 <span class="pf-v6-c-button__text">Multiple</span>
46 </button>
47 <button class="pf-v6-c-button pf-m-link" type="button">
48 <span class="pf-v6-c-button__text">Action buttons</span>
49 </button>
50 <button class="pf-v6-c-button pf-m-link" type="button">
51 <span class="pf-v6-c-button__text">Can</span>
52 </button>
53 <button class="pf-v6-c-button pf-m-link" type="button">
54 <span class="pf-v6-c-button__text">Go here</span>
55 </button>
56 <button class="pf-v6-c-button pf-m-link" type="button">
57 <span class="pf-v6-c-button__text">In the second</span>
58 </button>
59 <button class="pf-v6-c-button pf-m-link" type="button">
60 <span class="pf-v6-c-button__text">Action area</span>
61 </button>
62 </div>
63 </div>
64 </div>
65 </div>
66
67 ```
68
69 ### Extra small
70
71 ```html
72 <div class="pf-v6-c-empty-state pf-m-xs">
73 <div class="pf-v6-c-empty-state__content">
74 <div class="pf-v6-c-empty-state__header">
75 <div class="pf-v6-c-empty-state__icon">
76 <svg
77 class="pf-v6-svg"
78 fill="currentColor"
79 viewBox="0 0 512 512"
80 aria-hidden="true"
81 role="img"
82 width="1em"
83 height="1em"
84 >
85 <path
86 d="M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"
87 />
88 </svg>
89 </div>
90 <div class="pf-v6-c-empty-state__title">
91 <h4 class="pf-v6-c-empty-state__title-text">Empty state</h4>
92 </div>
93 </div>
94
95 <div
96 class="pf-v6-c-empty-state__body"
97 >This represents an the empty state pattern in PatternFly. The icon is optional.</div>
98
99 <div class="pf-v6-c-empty-state__footer">
100 <div class="pf-v6-c-empty-state__actions">
101 <button class="pf-v6-c-button pf-m-small pf-m-link" type="button">
102 <span class="pf-v6-c-button__text">Multiple</span>
103 </button>
104 <button class="pf-v6-c-button pf-m-small pf-m-link" type="button">
105 <span class="pf-v6-c-button__text">Action buttons</span>
106 </button>
107 <button class="pf-v6-c-button pf-m-small pf-m-link" type="button">
108 <span class="pf-v6-c-button__text">Can</span>
109 </button>
110 <button class="pf-v6-c-button pf-m-small pf-m-link" type="button">
111 <span class="pf-v6-c-button__text">Go here</span>
112 </button>
113 <button class="pf-v6-c-button pf-m-small pf-m-link" type="button">
114 <span class="pf-v6-c-button__text">In the</span>
115 </button>
116 <button class="pf-v6-c-button pf-m-small pf-m-link" type="button">
117 <span class="pf-v6-c-button__text">Action area</span>
118 </button>
119 </div>
120 </div>
121 </div>
122 </div>
123
124 ```
125
126 ### Small
127
128 ```html
129 <div class="pf-v6-c-empty-state pf-m-sm">
130 <div class="pf-v6-c-empty-state__content">
131 <div class="pf-v6-c-empty-state__header">
132 <div class="pf-v6-c-empty-state__icon">
133 <svg
134 class="pf-v6-svg"
135 fill="currentColor"
136 viewBox="0 0 512 512"
137 aria-hidden="true"
138 role="img"
139 width="1em"
140 height="1em"
141 >
142 <path
143 d="M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"
144 />
145 </svg>
146 </div>
147 <div class="pf-v6-c-empty-state__title">
148 <h4 class="pf-v6-c-empty-state__title-text">Empty state</h4>
149 </div>
150 </div>
151
152 <div
153 class="pf-v6-c-empty-state__body"
154 >This represents an the empty state pattern in PatternFly. Hopefully it's simple enough to use but flexible enough to meet a variety of needs.</div>
155
156 <div class="pf-v6-c-empty-state__footer">
157 <div class="pf-v6-c-empty-state__actions">
158 <button class="pf-v6-c-button pf-m-primary" type="button">
159 <span class="pf-v6-c-button__text">Primary action</span>
160 </button>
161 </div>
162
163 <div class="pf-v6-c-empty-state__actions">
164 <button class="pf-v6-c-button pf-m-link" type="button">
165 <span class="pf-v6-c-button__text">Multiple</span>
166 </button>
167 <button class="pf-v6-c-button pf-m-link" type="button">
168 <span class="pf-v6-c-button__text">Action buttons</span>
169 </button>
170 <button class="pf-v6-c-button pf-m-link" type="button">
171 <span class="pf-v6-c-button__text">Can</span>
172 </button>
173 <button class="pf-v6-c-button pf-m-link" type="button">
174 <span class="pf-v6-c-button__text">Go here</span>
175 </button>
176 <button class="pf-v6-c-button pf-m-link" type="button">
177 <span class="pf-v6-c-button__text">In the second</span>
178 </button>
179 <button class="pf-v6-c-button pf-m-link" type="button">
180 <span class="pf-v6-c-button__text">Action area</span>
181 </button>
182 </div>
183 </div>
184 </div>
185 </div>
186
187 ```
188
189 ### Large
190
191 ```html
192 <div class="pf-v6-c-empty-state pf-m-lg">
193 <div class="pf-v6-c-empty-state__content">
194 <div class="pf-v6-c-empty-state__header">
195 <div class="pf-v6-c-empty-state__icon">
196 <svg
197 class="pf-v6-svg"
198 fill="currentColor"
199 viewBox="0 0 512 512"
200 aria-hidden="true"
201 role="img"
202 width="1em"
203 height="1em"
204 >
205 <path
206 d="M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"
207 />
208 </svg>
209 </div>
210 <div class="pf-v6-c-empty-state__title">
211 <h4 class="pf-v6-c-empty-state__title-text">Empty state</h4>
212 </div>
213 </div>
214
215 <div
216 class="pf-v6-c-empty-state__body"
217 >This represents an the empty state pattern in PatternFly. Hopefully it's simple enough to use but flexible enough to meet a variety of needs.</div>
218
219 <div class="pf-v6-c-empty-state__footer">
220 <div class="pf-v6-c-empty-state__actions">
221 <button class="pf-v6-c-button pf-m-primary" type="button">
222 <span class="pf-v6-c-button__text">Primary action</span>
223 </button>
224 </div>
225 <div class="pf-v6-c-empty-state__actions">
226 <button class="pf-v6-c-button pf-m-link" type="button">
227 <span class="pf-v6-c-button__text">Multiple</span>
228 </button>
229 <button class="pf-v6-c-button pf-m-link" type="button">
230 <span class="pf-v6-c-button__text">Action buttons</span>
231 </button>
232 <button class="pf-v6-c-button pf-m-link" type="button">
233 <span class="pf-v6-c-button__text">Can</span>
234 </button>
235 <button class="pf-v6-c-button pf-m-link" type="button">
236 <span class="pf-v6-c-button__text">Go here</span>
237 </button>
238 <button class="pf-v6-c-button pf-m-link" type="button">
239 <span class="pf-v6-c-button__text">In the second</span>
240 </button>
241 <button class="pf-v6-c-button pf-m-link" type="button">
242 <span class="pf-v6-c-button__text">Action area</span>
243 </button>
244 </div>
245 </div>
246 </div>
247 </div>
248
249 ```
250
251 ### Extra large
252
253 ```html
254 <div class="pf-v6-c-empty-state pf-m-xl">
255 <div class="pf-v6-c-empty-state__content">
256 <div class="pf-v6-c-empty-state__header">
257 <div class="pf-v6-c-empty-state__icon">
258 <svg
259 class="pf-v6-svg"
260 fill="currentColor"
261 viewBox="0 0 512 512"
262 aria-hidden="true"
263 role="img"
264 width="1em"
265 height="1em"
266 >
267 <path
268 d="M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"
269 />
270 </svg>
271 </div>
272 <div class="pf-v6-c-empty-state__title">
273 <h4 class="pf-v6-c-empty-state__title-text">Empty state</h4>
274 </div>
275 </div>
276
277 <div
278 class="pf-v6-c-empty-state__body"
279 >This represents an the empty state pattern in PatternFly. Hopefully it's simple enough to use but flexible enough to meet a variety of needs.</div>
280 <div class="pf-v6-c-empty-state__footer">
281 <div class="pf-v6-c-empty-state__actions">
282 <button class="pf-v6-c-button pf-m-primary" type="button">
283 <span class="pf-v6-c-button__text">Primary action</span>
284 </button>
285 </div>
286 <div class="pf-v6-c-empty-state__actions">
287 <button class="pf-v6-c-button pf-m-link" type="button">
288 <span class="pf-v6-c-button__text">Multiple</span>
289 </button>
290 <button class="pf-v6-c-button pf-m-link" type="button">
291 <span class="pf-v6-c-button__text">Action buttons</span>
292 </button>
293 <button class="pf-v6-c-button pf-m-link" type="button">
294 <span class="pf-v6-c-button__text">Can</span>
295 </button>
296 <button class="pf-v6-c-button pf-m-link" type="button">
297 <span class="pf-v6-c-button__text">Go here</span>
298 </button>
299 <button class="pf-v6-c-button pf-m-link" type="button">
300 <span class="pf-v6-c-button__text">In the second</span>
301 </button>
302 <button class="pf-v6-c-button pf-m-link" type="button">
303 <span class="pf-v6-c-button__text">Action area</span>
304 </button>
305 </div>
306 </div>
307 </div>
308 </div>
309
310 ```
311
312 ### With status
313
314 ```html
315 <div class="pf-v6-c-empty-state pf-m-success">
316 <div class="pf-v6-c-empty-state__content">
317 <div class="pf-v6-c-empty-state__header">
318 <div class="pf-v6-c-empty-state__icon">
319 <svg
320 class="pf-v6-svg"
321 fill="currentColor"
322 viewBox="0 0 512 512"
323 aria-hidden="true"
324 role="img"
325 width="1em"
326 height="1em"
327 >
328 <path
329 d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"
330 />
331 </svg>
332 </div>
333 <div class="pf-v6-c-empty-state__title">
334 <h4 class="pf-v6-c-empty-state__title-text">You're all set</h4>
335 </div>
336 </div>
337
338 <div
339 class="pf-v6-c-empty-state__body"
340 >This represents an the empty state pattern in PatternFly. Hopefully it's simple enough to use but flexible enough to meet a variety of needs.</div>
341
342 <div class="pf-v6-c-empty-state__footer">
343 <div class="pf-v6-c-empty-state__actions">
344 <button class="pf-v6-c-button pf-m-primary" type="button">
345 <span class="pf-v6-c-button__text">Primary action</span>
346 </button>
347 </div>
348 <div class="pf-v6-c-empty-state__actions">
349 <button class="pf-v6-c-button pf-m-link" type="button">
350 <span class="pf-v6-c-button__text">Multiple</span>
351 </button>
352 <button class="pf-v6-c-button pf-m-link" type="button">
353 <span class="pf-v6-c-button__text">Action buttons</span>
354 </button>
355 <button class="pf-v6-c-button pf-m-link" type="button">
356 <span class="pf-v6-c-button__text">Can</span>
357 </button>
358 <button class="pf-v6-c-button pf-m-link" type="button">
359 <span class="pf-v6-c-button__text">Go here</span>
360 </button>
361 <button class="pf-v6-c-button pf-m-link" type="button">
362 <span class="pf-v6-c-button__text">In the second</span>
363 </button>
364 <button class="pf-v6-c-button pf-m-link" type="button">
365 <span class="pf-v6-c-button__text">Action area</span>
366 </button>
367 </div>
368 </div>
369 </div>
370 </div>
371
372 ```
373
374 ## Documentation
375
376 ### Accessibility
377
378 | Attribute | Applied to | Outcome |
379 | -- | -- | -- |
380 | `aria-hidden="true"` | `.pf-v6-c-empty-state__icon` | Hides icon for assistive technologies. **Required** |
381
382 ### Usage
383
384 | Class | Applied to | Outcome |
385 | -- | -- | -- |
386 | `.pf-v6-c-empty-state` | `<div>` | Initiates an empty state component. The empty state centers its content (`.pf-v6-c-empty-state__content`) vertically and horizontally. **Required** |
387 | `.pf-v6-c-empty-state__content` | `<div>` | Creates the content container. **Required** |
388 | `.pf-v6-c-empty-state__header` | `<div>` | Creates the header container. **Required** |
389 | `.pf-v6-c-empty-state__title` | `<div>` | Creates the empty state title container. **Required** |
390 | `.pf-v6-c-empty-state__title-text` | `<h1>`, `<h2>`, `<h3>`, `<h4>`, `<h5>`, `<h6>`, `<div>` | Creates the empty state title text container. |
391 | `.pf-v6-c-empty-state__icon` | `<div>` | Creates the empty state icon container. |
392 | `.pf-v6-c-empty-state__body` | `<div>` | Creates the empty state body content. There can be more than one `.pf-v6-c-empty-state__body` elements. |
393 | `.pf-v6-c-empty-state__footer` | `<div>` | Creates the footer container. **Required** |
394 | `.pf-v6-c-empty-state__actions` | `<div>` | Container for actions. **Required** |
395 | `.pf-m-xs` | `.pf-v6-c-empty-state` | Modifies the empty state for an extra small variation and max-width. |
396 | `.pf-m-sm` | `.pf-v6-c-empty-state` | Modifies the empty state for a small max-width. |
397 | `.pf-m-lg` | `.pf-v6-c-empty-state` | Modifies the empty state for a large max-width. |
398 | `.pf-m-xl` | `.pf-v6-c-empty-state` | Modifies the empty state for an extra large variation and max-width. |
399 | `.pf-m-full-height` | `.pf-v6-c-empty-state` | Modifies the empty state to be `height: 100%`. If you need the empty state content to be centered vertically, you can use this modifier to make the empty state fill the height of its container, and center `.pf-v6-c-empty-state__content`. **Note:** this modifier requires the parent of `.pf-v6-c-empty-state` have an implicit or explicit `height` defined. |
400 | `.pf-m-danger` | `.pf-v6-c-empty-state` | Modifies the empty state for danger status. |
401 | `.pf-m-warning` | `.pf-v6-c-empty-state` | Modifies the empty state for warning status. |
402 | `.pf-m-success` | `.pf-v6-c-empty-state` | Modifies the empty state for success status. |
403 | `.pf-m-info` | `.pf-v6-c-empty-state` | Modifies the empty state for info status. |
404 | `.pf-m-custom` | `.pf-v6-c-empty-state` | Modifies the empty state for custom status. |