AvatarGroup

Data Display
stable

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

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

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

All props accepted by this component, with their type, default value and 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

Content slots exposed by this component.

#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

Events emitted by this component.

@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

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<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.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

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

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

group

Keyboard interactions

Keyboard interactions
KeyAction
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.

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

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

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Basic group

vue

Expand on hover

vue

Vertical direction

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.