Data display
Layout
AvatarGroup
Several avatars stacked into one overlapping row, with a count for the ones that don’t fit. Use it to show who belongs to a team, a chat or a document.
Install
import { AvatarGroup } from 'vael-ui'Playground
ALGHKJ
md
Usage
<script setup lang="ts">
import { AvatarGroup, Avatar } from 'vael-ui'
</script>
<template>
<AvatarGroup>
<Avatar name="Ada Lovelace" />
<Avatar name="Grace Hopper" />
<Avatar name="Katherine Johnson" />
</AvatarGroup>
</template>Motion New
AvatarGroup: its appearance, avatar by avatar.
<AvatarGroup
:motion="{ initial: { root: { opacity: 0, y: 8 } }, stagger: 0.04 }"
/>| Name | Type | Description |
|---|---|---|
initialexit | rootavatar | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
staggerleavingappear | number | 'pop' | 'hold' | boolean | Items coming in together start stagger seconds apart. A leaving item lifts out so the rest close the gap ('pop'), or keeps its space until it's gone ('hold'). appear: true also brings in the items already there when it mounts. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
It has no keyboard interaction of its own.
- The group is a
<div>with no role. Each Avatar keeps its ownalt. - Screen readers read the overflow avatar as its text, such as “+3”. The
#overflowslot receivescountif you want other wording.