1
1
---
2
2
title : " ion-avatar"
3
- hide_table_of_contents : true
4
- demoUrl : " /docs/demos/api/avatar/index.html"
5
- demoSourceUrl : " https://github.com/ionic-team/ionic-docs/tree/main/static/demos/api/avatar/index.html"
6
3
---
7
- import Tabs from '@theme/Tabs ';
8
- import TabItem from '@theme/TabItem ';
9
4
10
5
import Props from '@site/static /auto-generated/avatar/props.md';
11
6
import Events from '@site/static /auto-generated/avatar/events.md';
@@ -20,186 +15,36 @@ import Slots from '@site/static/auto-generated/avatar/slots.md';
20
15
</head >
21
16
22
17
import EncapsulationPill from '@components/page /api/EncapsulationPill';
23
- import APITOCInline from '@components/page /api/APITOCInline';
24
18
25
19
<EncapsulationPill type =" shadow " />
26
20
27
- <h2 className =" table-of-contents__title " >Contents</h2 >
28
-
29
- <APITOCInline
30
- toc={toc}
31
- maxHeadingLevel={2}
32
- autogenerated={[ Props, Events, Methods, Parts, CustomProps, Slots] }
33
- />
34
-
35
-
36
-
37
21
Avatars are circular components that usually wrap an image or icon. They can be used to represent a person or an object.
38
22
39
23
Avatars can be used by themselves or inside of any element. If placed inside of an ` ion-chip ` or ` ion-item ` , the avatar will resize to fit the parent component. To position an avatar on the left or right side of an item, set the slot to ` start ` or ` end ` , respectively.
40
24
25
+ ## Basic
41
26
27
+ import Basic from '@site/static /usage/avatar/basic/index.md';
42
28
29
+ <Basic />
43
30
44
- ## Usage
31
+ ## Chip Avatar
45
32
46
- <Tabs groupId="framework" defaultValue="angular" values={ [ { value: 'angular', label: 'Angular' }, { value: 'javascript', label: 'Javascript' }, { value: 'react', label: 'React' }, { value: 'stencil', label: 'Stencil' }, { value: 'vue', label: 'Vue' } ] }>
33
+ import Chip from ' @ site/static /usage/avatar/chip/index.md';
47
34
48
- <TabItem value = " angular " >
35
+ <Chip / >
49
36
50
- ``` html
51
- <ion-avatar >
52
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
53
- </ion-avatar >
37
+ ## Item Avatar
54
38
55
- <ion-chip >
56
- <ion-avatar >
57
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
58
- </ion-avatar >
59
- <ion-label >Chip Avatar</ion-label >
60
- </ion-chip >
61
-
62
- <ion-item >
63
- <ion-avatar slot =" start" >
64
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
65
- </ion-avatar >
66
- <ion-label >Item Avatar</ion-label >
67
- </ion-item >
68
- ```
39
+ import Item from '@site/static /usage/avatar/item/index.md';
69
40
70
- </ TabItem >
41
+ <Item / >
71
42
43
+ ## Theming
72
44
73
- < TabItem value = " javascript " >
45
+ import Theming from ' @ site/static /usage/avatar/theming/index.md';
74
46
75
- ``` html
76
- <ion-avatar >
77
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
78
- </ion-avatar >
79
-
80
- <ion-chip >
81
- <ion-avatar >
82
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
83
- </ion-avatar >
84
- <ion-label >Chip Avatar</ion-label >
85
- </ion-chip >
86
-
87
- <ion-item >
88
- <ion-avatar slot =" start" >
89
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
90
- </ion-avatar >
91
- <ion-label >Item Avatar</ion-label >
92
- </ion-item >
93
- ```
94
-
95
- </TabItem >
96
-
97
-
98
- <TabItem value =" react " >
99
-
100
- ``` tsx
101
- import React from ' react' ;
102
- import { IonAvatar , IonChip , IonItem , IonLabel , IonContent } from ' @ionic/react' ;
103
-
104
- export const AvatarExample: React .FC = () => (
105
- <IonContent >
106
- <IonAvatar >
107
- <img src = " https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
108
- </IonAvatar >
109
-
110
- <IonChip >
111
- <IonAvatar >
112
- <img src = " https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
113
- </IonAvatar >
114
- <IonLabel >Chip Avatar</IonLabel >
115
- </IonChip >
116
-
117
- <IonItem >
118
- <IonAvatar slot = " start" >
119
- <img src = " https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
120
- </IonAvatar >
121
- <IonLabel >Item Avatar</IonLabel >
122
- </IonItem >
123
- </IonContent >
124
- );
125
- ```
126
-
127
- </TabItem >
128
-
129
-
130
- <TabItem value =" stencil " >
131
-
132
- ``` tsx
133
- import { Component , h } from ' @stencil/core' ;
134
-
135
- @Component ({
136
- tag: ' avatar-example' ,
137
- styleUrl: ' avatar-example.css'
138
- })
139
- export class AvatarExample {
140
- render() {
141
- return [
142
- <ion-avatar >
143
- <img src = " https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
144
- </ion-avatar >,
145
-
146
- <ion-chip >
147
- <ion-avatar >
148
- <img src = " https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
149
- </ion-avatar >
150
- <ion-label >Chip Avatar</ion-label >
151
- </ion-chip >,
152
-
153
- <ion-item >
154
- <ion-avatar slot = " start" >
155
- <img src = " https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" />
156
- </ion-avatar >
157
- <ion-label >Item Avatar</ion-label >
158
- </ion-item >
159
- ];
160
- }
161
- }
162
- ```
163
-
164
- </TabItem >
165
-
166
-
167
- <TabItem value =" vue " >
168
-
169
- ``` html
170
- <template >
171
- <ion-avatar >
172
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
173
- </ion-avatar >
174
-
175
- <ion-chip >
176
- <ion-avatar >
177
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
178
- </ion-avatar >
179
- <ion-label >Chip Avatar</ion-label >
180
- </ion-chip >
181
-
182
- <ion-item >
183
- <ion-avatar slot =" start" >
184
- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
185
- </ion-avatar >
186
- <ion-label >Item Avatar</ion-label >
187
- </ion-item >
188
- </template >
189
-
190
- <script >
191
- import { IonAvatar , IonChip , IonItem , IonLabel } from ' @ionic/vue' ;
192
- import { defineComponent } from ' vue' ;
193
-
194
- export default defineComponent ({
195
- components: { IonAvatar, IonChip, IonItem, IonLabel }
196
- });
197
- </script >
198
- ```
199
-
200
- </TabItem >
201
-
202
- </Tabs >
47
+ <Theming />
203
48
204
49
## Properties
205
50
<Props />
@@ -217,4 +62,4 @@ export default defineComponent({
217
62
<CustomProps />
218
63
219
64
## Slots
220
- <Slots />
65
+ <Slots />
0 commit comments