@@ -3,6 +3,7 @@ title: Avatars
33path : components/avatars
44status : Stable
55source : ' https://github.com/primer/css/tree/main/src/avatars'
6+ rails : ' https://primer.style/view-components/components/beta/avatar'
67bundle : avatars
78---
89
@@ -52,152 +53,6 @@ When you need a larger parent avatar, and a smaller child one, overlaid slightly
5253</div >
5354```
5455
55- ### Avatar stack
56-
57- Stacked avatars can be used to show multiple collaborators or participants when there is limited space available. When you hover over the stack, the avatars will reveal themselves.
58-
59- ``` html live
60- <div class =" AvatarStack AvatarStack--three-plus" >
61- <div
62- class =" AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1"
63- aria-label =" octocat, octocat, and octocat"
64- >
65- <img
66- class =" avatar"
67- height =" 20"
68- alt =" @octocat"
69- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
70- width =" 20"
71- />
72- <img
73- class =" avatar"
74- height =" 20"
75- alt =" @octocat"
76- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
77- width =" 20"
78- />
79- <img
80- class =" avatar"
81- height =" 20"
82- alt =" @octocat"
83- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
84- width =" 20"
85- />
86- </div >
87- </div >
88- ```
89-
90- Based on the number of avatars in the stack, add these modifier classes:
91-
92- - ` AvatarStack--two ` for 2 avatars.
93- - ` AvatarStack--three-plus ` for 3 or more avatars.
94-
95- If you have more than three avatars, add a div with the classes ` avatar avatar-more ` as the third avatar in the stack, as such:
96-
97- ``` html live
98- <div class =" AvatarStack AvatarStack--three-plus" >
99- <div
100- class =" AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1"
101- aria-label =" octocat, octocat, octocat, octocat, and octocat"
102- >
103- <img
104- class =" avatar"
105- height =" 20"
106- alt =" @octocat"
107- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
108- width =" 20"
109- />
110- <img
111- class =" avatar"
112- height =" 20"
113- alt =" @octocat"
114- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
115- width =" 20"
116- />
117- <div class =" avatar avatar-more" ></div >
118- <img
119- class =" avatar"
120- height =" 20"
121- alt =" @octocat"
122- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
123- width =" 20"
124- />
125- <img
126- class =" avatar"
127- height =" 20"
128- alt =" @octocat"
129- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
130- width =" 20"
131- />
132- <img
133- class =" avatar"
134- height =" 20"
135- alt =" @octocat"
136- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
137- width =" 20"
138- />
139- </div >
140- </div >
141- ```
142-
143- You can also link individual avatars. To do this shift the ` avatar ` class over to the anchor:
144-
145- ``` html live
146- <div class =" AvatarStack AvatarStack--two" >
147- <div class =" AvatarStack-body tooltipped tooltipped-se tooltipped-align-left-1" aria-label =" octocat and octocat" >
148- <a href =" #" class =" avatar" >
149- <img
150- height =" 20"
151- alt =" @octocat"
152- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
153- width =" 20"
154- />
155- </a >
156- <a href =" #" class =" avatar" >
157- <img
158- height =" 20"
159- alt =" @octocat"
160- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
161- width =" 20"
162- />
163- </a >
164- </div >
165- </div >
166- ```
167-
168- Use ` AvatarStack--right ` to right-align the avatar stack. Remember to switch the alignment of tooltips when making this change.
169-
170- ``` html live
171- <div class =" AvatarStack AvatarStack--three-plus AvatarStack--right" >
172- <div
173- class =" AvatarStack-body tooltipped tooltipped-sw tooltipped-align-right-1"
174- aria-label =" octocat, octocat, and octocat"
175- >
176- <img
177- class =" avatar"
178- height =" 20"
179- alt =" @octocat"
180- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
181- width =" 20"
182- />
183- <img
184- class =" avatar"
185- height =" 20"
186- alt =" @octocat"
187- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
188- width =" 20"
189- />
190- <img
191- class =" avatar"
192- height =" 20"
193- alt =" @octocat"
194- src =" https://user-images.githubusercontent.com/334891/29999089-2837c968-9009-11e7-92c1-6a7540a594d5.png"
195- width =" 20"
196- />
197- </div >
198- </div >
199- ```
200-
20156## Circle badge
20257
20358` .CircleBadge ` allows for the display of badge-like icons or logos. They are used mostly with Octicons or partner integration icons.
0 commit comments