››avatar
Avatar
A person's picture with initials or an icon as fallback and an optional status badge; a group overlaps several and shows how many more there are.
Parts
| Part | File | Does |
|---|---|---|
| Avatar | Avatar.vue | Groups the image, fallback and badge of an avatar. |
| AvatarBadge | AvatarBadge.vue | Shows a small status marker on the corner of the avatar. |
| AvatarFallback | AvatarFallback.vue | Shows initials or an icon when the avatar image is missing or fails to load. |
| AvatarGroup | AvatarGroup.vue | Stacks several avatars in an overlapping row. |
| AvatarGroupCount | AvatarGroupCount.vue | Shows how many more avatars the group holds than it displays. |
| AvatarImage | AvatarImage.vue | Shows the picture of the avatar. |
Anatomy
<AvatarGroup>
<Avatar>
<AvatarImage />
<AvatarFallback />
<AvatarBadge />
</Avatar>
<AvatarGroupCount />
</AvatarGroup>Styling
All of Avatar’s styles live in avatar.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- @vueuse/core
- class-variance-authority
- reka-ui
API reference
Groups the image, fallback and badge of an avatar. Renders a <span>.
Props 2
| Prop | Type | Default | |
|---|---|---|---|
| class | ClassValue | — | |
| |||
| size | AvatarSize | — | |
| |||
Data attributes 1
| Data attribute | Values | |
|---|---|---|
| data-size | 'md' | 'sm' | 'lg' | |
| ||
Recipe avatar 4 groups
rounded rounded.full9999px
display flex
flexShrink 0
border :afterborder.default1px solid #e4e4e7
rounded :afterrounded.full9999px
size spacing.61.5rem
size spacing.82rem
size spacing.102.5rem
Recipe avatar-ring 1 group
outline ring.frame2px solid #ffffff
outlineColor colors.background#ffffff
Avatar