AvatarGroup

Data Display
stable

Stacked group of Avatar components with overflow counter, expand-on-hover and expand-on-click behaviours.

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamAvatarGroupSchematic of the AvatarGroup component with 3 numbered parts. +N 1 2 3 origam-avatar-group __item (×N) __rest (+N chip) Avatars overlap via negative margin; __rest is always last.
Anatomy of <origam-avatar-group> — 3 parts: root wrapper, item avatars and overflow rest chip.
1.origam-avatar-group
Root element. Renders as an inline-flex container with role="group". Direction modifier class controls flex-direction.
2.origam-avatar-group__item
Each visible avatar. Receives a negative margin-inline-start (horizontal) or margin-block-start (vertical) to create the overlap stack effect.
3.origam-avatar-group__rest
Overflow avatar showing the +N count. Visible only when items.length > max. Same overlap margin as __item.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

items
Array<IAvatarProps>
[]
Array of avatar data objects. Each entry is forwarded as props to an inner OrigamAvatar.
max
number
5
Maximum number of avatars to show before collapsing into a +N overflow chip.
expandOnHover
boolean
false
When true, hovering the group expands all hidden avatars by setting margin to 0.
expandOnClick
boolean
false
When true, clicking the group toggles the expanded state. Collapses when clicking outside.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
direction
'horizontal'
Stacking direction. horizontal stacks left-to-right; vertical stacks top-to-bottom.
density
Density forwarded to every child avatar.
Border-radius forwarded to every child avatar.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
Size applied to every child avatar via OrigamDefaultsProvider.
tag
string
'div'
HTML element rendered as the group root.
color
Foreground color forwarded to every child avatar.
bgColor
Background color forwarded to every child avatar.
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
elevation
TElevation
Box-shadow elevation forwarded to every child avatar.
hover
boolean | IStateEffectConfig
hoverClass
string
active
boolean | IStateEffectConfig
activeClass
string

API

Slots

Emplacements de contenu exposés par ce composant.

#avatar
Override the rendering of each visible avatar. Receives the item data and its index.
#rest
Override the +N overflow chip. Receives the hidden items array and its length.
#default
Content inside the overflow chip avatar (the +N label). Replaces the default count text.

API

Emits

Événements émis par ce composant.

@update:active
any
@hover
boolean
Fired when the hover state changes. Propagated from the group interaction.
@update:hover
boolean
@active
boolean
Fired when the active/click state changes (expand-on-click groups).

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to a child component.
Ref<string>
Reactive CSS string generated by useStyle from the computed group styles.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet into the document.
() => void
Removes the injected style sheet.
Ref<boolean>
True once the style sheet has been injected.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

CSS position of the group root.
Flex direction. Overridden by direction modifier classes.
Density offset. compact: -6px, comfortable: 10px. Applied to overlap margin calculation.
Horizontal overlap margin for each avatar item (horizontal mode).
Transition duration for the margin animation on expand.

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

group

Interactions clavier

Interactions clavier
ToucheAction
TabMoves focus through each interactive avatar within the group.
Enter / SpaceActivates expand-on-click behaviour when expandOnClick=true.

Notes

  • The root element has role="group" to semantically group related avatars for screen readers.
  • When expandOnClick=true, clicking outside the group (v-click-outside) collapses it automatically.
  • Transition on the overlap margin respects prefers-reduced-motion via the transition-property var.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

Source
dimension
0px
Density offset applied to overlap margin calculation.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Basic group

vue

Expand on hover

vue

Vertical direction

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.