File: Avatar.md

package info (click to toggle)
cockpit 354-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 308,956 kB
  • sloc: javascript: 775,606; python: 40,351; ansic: 35,655; cpp: 11,117; sh: 3,511; makefile: 580; xml: 261
file content (94 lines) | stat: -rw-r--r-- 2,080 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
id: Avatar
section: components
cssPrefix: pf-v6-c-avatar
---## Examples

### Basic

```html
<img
  class="pf-v6-c-avatar"
  alt="Avatar image"
  src="/assets/images/img_avatar-light.svg"
/>

```

### Bordered

```html
<img
  class="pf-v6-c-avatar pf-m-bordered"
  alt="Avatar image bordered"
  src="/assets/images/img_avatar-light.svg"
/>

```

### Small

```html
<img
  class="pf-v6-c-avatar pf-m-sm"
  alt="Avatar image small"
  src="/assets/images/img_avatar-light.svg"
/>

```

### Medium

```html
<img
  class="pf-v6-c-avatar pf-m-md"
  alt="Avatar image medium"
  src="/assets/images/img_avatar-light.svg"
/>

```

### Large

```html
<img
  class="pf-v6-c-avatar pf-m-lg"
  alt="Avatar image large"
  src="/assets/images/img_avatar-light.svg"
/>

```

### Extra large

```html
<img
  class="pf-v6-c-avatar pf-m-xl"
  alt="Avatar image extra large"
  src="/assets/images/img_avatar-light.svg"
/>

```

## Documentation

### Overview

The avatar component provides a default SVG icon. If an image is used it should be 36px by 36px.

### Accessibility

| Attribute | Applied to | Outcome |
| -- | -- | -- |
| `alt` | `.pf-v6-c-avatar` | The alt attribute describes the appearance and function of the avatar image. **Required** |

### Usage

| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-c-avatar` | `<img>` |  Initiates an avatar image. **Required** |
| `.pf-m-bordered` | `.pf-v6-c-avatar` | Modifies an avatar to have a border. |
| `.pf-m-sm{-on-[breakpoint]}` | `.pf-v6-c-avatar` | Modifies an avatar to be small on an optional [breakpoint](/tokens/all-patternfly-tokens). |
| `.pf-m-md{-on-[breakpoint]}` | `.pf-v6-c-avatar` | Modifies an avatar to be medium on an optional [breakpoint](/tokens/all-patternfly-tokens). **Note:** This is the default size. |
| `.pf-m-lg{-on-[breakpoint]}` | `.pf-v6-c-avatar` | Modifies an avatar to be large on an optional [breakpoint](/tokens/all-patternfly-tokens). |
| `.pf-m-xl{-on-[breakpoint]}` | `.pf-v6-c-avatar` | Modifies an avatar to be extra large on an optional [breakpoint](/tokens/all-patternfly-tokens). |