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/ui-avatar/src/Avatar/README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,34 @@ describes: Avatar
4
4
5
5
The avatar component can be used to display a user's avatar. When an image src is not supplied the user's initials will display.
6
6
7
+
## Variant
8
+
9
+
Avatar has a variant prop, which currently only toggles it between `ai` and `default` behavior. `ai` is a preset where you can only change the `size` and `margin` visual props, all others are preset. In the following example, there are the `ai` variants.
10
+
11
+
### ai
12
+
13
+
```js
14
+
---
15
+
type: example
16
+
readonly:true
17
+
---
18
+
<div>
19
+
<View display="block" padding="small medium">
20
+
<Avatar variant="ai" size="xx-small" margin="0 small 0 0"/>
21
+
<Avatar variant="ai" size="x-small" margin="0 small 0 0"/>
22
+
<Avatar variant="ai" size="small" margin="0 small 0 0"/>
23
+
<Avatar variant="ai" size="medium" margin="0 small 0 0"/>
24
+
<Avatar variant="ai" size="large" margin="0 small 0 0"/>
25
+
<Avatar variant="ai" size="x-large" margin="0 small 0 0"/>
26
+
<Avatar variant="ai" size="xx-large"/>
27
+
</View>
28
+
</div>
29
+
```
30
+
31
+
### default
32
+
33
+
Most avatar's features are accessible through the `default` variant
34
+
7
35
Instead of the initials, an SVG icon can be displayed with the `renderIcon` property.
8
36
9
37
The avatar can be `circle`_(default)_ or `rectangle`. Use the `margin` prop to add space between Avatar and other content.
0 commit comments