Skip to content

Commit 2d1e820

Browse files
authored
docs: avatar Aura style variants and props (#4862)
1 parent c80f62c commit 2d1e820

File tree

5 files changed

+111
-225
lines changed

5 files changed

+111
-225
lines changed

articles/components/avatar/index.adoc

Lines changed: 8 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -318,83 +318,33 @@ include::{root}/frontend/demo/component/avatar/react/avatar-group-internationali
318318
endif::[]
319319
--
320320

321-
== Size Variants
322321

323-
Avatar has four available size variants:
322+
== Use Cases
323+
324+
Avatar can be paired with Popover to create a user account menu.
324325

325326
[.example]
326327
--
327328

328-
ifdef::lit[]
329329
[source,html]
330330
----
331-
include::{root}/frontend/demo/component/avatar/avatar-sizes.ts[render,tags=snippet,indent=0,group=Lit]
331+
include::{root}/frontend/demo/component/popover/popover-user-menu.ts[render,tags=snippet,indent=0,group=Lit]
332332
----
333-
endif::[]
334333

335-
ifdef::flow[]
336334
[source,java]
337335
----
338-
include::{root}/src/main/java/com/vaadin/demo/component/avatar/AvatarSizes.java[render,tags=snippet,indent=0,group=Flow]
336+
include::{root}/src/main/java/com/vaadin/demo/component/popover/PopoverUserMenu.java[render,tags=snippet,indent=0,group=Flow]
339337
----
340-
endif::[]
341338

342-
ifdef::react[]
343339
[source,tsx]
344340
----
345-
include::{root}/frontend/demo/component/avatar/react/avatar-sizes.tsx[render,tags=snippet,indent=0,group=React]
346-
----
347-
endif::[]
348-
--
349-
350-
|===
351-
| Variant | Theme name
352-
353-
|Extra large
354-
|`xlarge`
355-
356-
|Large
357-
|`large`
358-
359-
|Small
360-
|`small`
361-
362-
|Extra small
363-
|`xsmall`
364-
365-
|===
366-
367-
Size variants should be used only in special cases.
368-
See <<{articles}/styling/lumo/lumo-style-properties/size-space#,Size and Space>> for details on how to
369-
change the default Avatar size.
370-
371-
== Use Cases
372-
373-
Avatar can be paired with Menu Bar to create a user account menu.
374-
375-
[.example]
376-
--
377-
378-
ifdef::lit[]
379-
[source,javascript]
380-
----
381-
include::{root}/frontend/demo/component/avatar/avatar-menu-bar.ts[render,tags=snippet,indent=0,group=Lit]
341+
include::{root}/frontend/demo/component/popover/react/popover-user-menu.tsx[render,tags=snippet,indent=0,group=React]
382342
----
383-
endif::[]
384343

385-
ifdef::flow[]
386-
[source,java]
344+
[source,css]
387345
----
388-
include::{root}/src/main/java/com/vaadin/demo/component/avatar/AvatarMenuBar.java[render,tags=snippet,indent=0,group=Flow]
346+
include::{root}/frontend/themes/docs/popover-user-menu.css[]
389347
----
390-
endif::[]
391-
392-
ifdef::react[]
393-
[source,tsx]
394-
----
395-
include::{root}/frontend/demo/component/avatar/react/avatar-menu-bar.tsx[render,tags=snippet,indent=0,group=React]
396-
----
397-
endif::[]
398348
--
399349

400350

articles/components/avatar/styling.adoc

Lines changed: 103 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,150 @@ order: 50
77
---
88
= Avatar Styling
99

10+
11+
== Style Variants
12+
13+
Avatar and Avatar Group support the following style variants:
14+
15+
[cols="1,3,1"]
16+
|===
17+
| Variant | Description | Supported by
18+
19+
|`reverse`
20+
|Reverses the stacking order of avatars in Avatar Group
21+
|Aura, Lumo
22+
23+
|`large`
24+
|Large avatar size
25+
|Lumo
26+
27+
|`small`
28+
|Small avatar size
29+
|Lumo
30+
31+
|`xlarge`
32+
|Extra large avatar size
33+
|Lumo
34+
35+
|`xsmall`
36+
|Extra small avatar size
37+
|Lumo
38+
39+
|===
40+
41+
42+
=== Size Variants
43+
44+
Avatar has four available size variants:
45+
46+
[.example]
47+
--
48+
49+
ifdef::lit[]
50+
[source,html]
51+
----
52+
include::{root}/frontend/demo/component/avatar/avatar-sizes.ts[render,tags=snippet,indent=0,group=Lit]
53+
----
54+
endif::[]
55+
56+
ifdef::flow[]
57+
[source,java]
58+
----
59+
include::{root}/src/main/java/com/vaadin/demo/component/avatar/AvatarSizes.java[render,tags=snippet,indent=0,group=Flow]
60+
----
61+
endif::[]
62+
63+
ifdef::react[]
64+
[source,tsx]
65+
----
66+
include::{root}/frontend/demo/component/avatar/react/avatar-sizes.tsx[render,tags=snippet,indent=0,group=React]
67+
----
68+
endif::[]
69+
--
70+
71+
Size variants should be used only in special cases.
72+
See <<{articles}/styling/lumo/lumo-style-properties/size-space#,Size and Space>> for details on how to
73+
change the default Avatar size.
74+
1075
include::../_styling-section-theming-props.adoc[tag=style-properties]
1176

1277
=== Common Properties
1378

1479
[cols="1,2,2"]
1580
|===
16-
| Feature | Property | Default Value
81+
| Feature | Property | Supported by
1782

1883
|Avatar size
1984
|`--vaadin-avatar-size`
20-
|`var(--lumo-size-m)`
85+
|Aura, Lumo
86+
87+
|Avatar background
88+
|`--vaadin-avatar-background`
89+
|Aura, Lumo
90+
91+
|Avatar border width
92+
|`--vaadin-avatar-border-width`
93+
|Aura
94+
95+
|Avatar border color
96+
|`--vaadin-avatar-border-color`
97+
|Aura
2198

2299
|Avatar Group overlap
23100
|`--vaadin-avatar-group-overlap`
24-
|`8px`
101+
|Aura, Lumo
25102

26-
|Avatar Group overlap border
27-
|`--vaadin-avatar-group-overlap-border`
28-
|`2px`
103+
|Avatar Group gap
104+
|`--vaadin-avatar-group-gap`
105+
|Aura, Lumo
29106

30107
|===
31108

32109
=== User Color Properties
33110

34111
[cols="1,2,2"]
35112
|===
36-
| Feature | Property | Default Value
113+
| Feature | Property | Supported by
37114

38115
|User color 0
39116
|`--vaadin-user-color-0`
40-
|`#df0b92`
117+
|Aura, Lumo
41118

42119
|User color 1
43120
|`--vaadin-user-color-1`
44-
|`#650acc`
121+
|Aura, Lumo
45122

46123
|User color 2
47124
|`--vaadin-user-color-2`
48-
|`#097faa`
125+
|Aura, Lumo
49126

50127
|User color 3
51128
|`--vaadin-user-color-3`
52-
|`#ad6200`
129+
|Aura, Lumo
53130

54131
|User color 4
55132
|`--vaadin-user-color-4`
56-
|`#bf16f3`
133+
|Aura, Lumo
57134

58135
|User color 5
59136
|`--vaadin-user-color-5`
60-
|`#084391`
137+
|Aura, Lumo
61138

62139
|User color 6
63140
|`--vaadin-user-color-6`
64-
|`#078836`
141+
|Aura, Lumo
142+
143+
|User color 7
144+
|`--vaadin-user-color-7`
145+
|Aura
146+
147+
|User color 8
148+
|`--vaadin-user-color-8`
149+
|Aura
150+
151+
|User color 9
152+
|`--vaadin-user-color-9`
153+
|Aura
65154

66155
|===
67156

frontend/demo/component/avatar/avatar-menu-bar.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

frontend/demo/component/avatar/react/avatar-menu-bar.tsx

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)