11---
22title : " 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"
63---
7- import Tabs from '@theme/Tabs ';
8- import TabItem from '@theme/TabItem ';
94
105import Props from '@site/static /auto-generated/avatar/props.md';
116import Events from '@site/static /auto-generated/avatar/events.md';
@@ -20,186 +15,36 @@ import Slots from '@site/static/auto-generated/avatar/slots.md';
2015</head >
2116
2217import EncapsulationPill from '@components/page /api/EncapsulationPill';
23- import APITOCInline from '@components/page /api/APITOCInline';
2418
2519<EncapsulationPill type =" shadow " />
2620
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-
3721Avatars are circular components that usually wrap an image or icon. They can be used to represent a person or an object.
3822
3923Avatars 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.
4024
25+ ## Basic
4126
27+ import Basic from '@site/static /usage/avatar/basic/index.md';
4228
29+ <Basic />
4330
44- ## Usage
31+ ## Chip Avatar
4532
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';
4734
48- <TabItem value = " angular " >
35+ <Chip / >
4936
50- ``` html
51- <ion-avatar >
52- <img src =" https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y" >
53- </ion-avatar >
37+ ## Item Avatar
5438
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';
6940
70- </ TabItem >
41+ <Item / >
7142
43+ ## Theming
7244
73- < TabItem value = " javascript " >
45+ import Theming from ' @ site/static /usage/avatar/theming/index.md';
7446
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 />
20348
20449## Properties
20550<Props />
@@ -217,4 +62,4 @@ export default defineComponent({
21762<CustomProps />
21863
21964## Slots
220- <Slots />
65+ <Slots />
0 commit comments