mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
docs(avatar): update avatar documentation
This commit is contained in:
@ -1,7 +1,28 @@
|
|||||||
# ion-avatar
|
# ion-avatar
|
||||||
|
|
||||||
An Avatar is a component that creates a circular image for an item.
|
Avatars are circular components that usually wrap an image or icon. They can be used to represent a person or an object.
|
||||||
Avatars can be placed on the left or right side of an item with the `item-start` or `item-end` directive.
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<ion-avatar>
|
||||||
|
<img src="https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y">
|
||||||
|
</ion-avatar>
|
||||||
|
|
||||||
|
<ion-chip>
|
||||||
|
<ion-avatar>
|
||||||
|
<img src="https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y">
|
||||||
|
</ion-avatar>
|
||||||
|
<ion-label>Chip Avatar</ion-label>
|
||||||
|
</ion-chip>
|
||||||
|
|
||||||
|
<ion-item>
|
||||||
|
<ion-avatar slot="start">
|
||||||
|
<img src="https://gravatar.com/avatar/dba6bae8c566f9d4041fb9cd9ada7741?d=identicon&f=y">
|
||||||
|
</ion-avatar>
|
||||||
|
<ion-label>Item Avatar</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
<!-- Auto Generated Below -->
|
<!-- Auto Generated Below -->
|
||||||
|
Reference in New Issue
Block a user