Data display

Avatar

@xui/avatar

A compact user/entity representation — image, text initials, or a projected icon, with an automatic fallback when the image fails. Group several with <xui-avatar-group> to overlap them, optionally collapsing past max.

Install

pnpm add @xui/avatar

Add the barrel to a standalone component's imports:

import { XuiAvatarImports } from '@xui/avatar';

@Component({
  imports: [XuiAvatarImports],
  // …
})

Examples

Variants

Loading preview…

Sizes

Loading preview…

Fallback

Loading preview…

Group

Loading preview…

API

XuiAvatarGroup

componentxui-avatar-group

Overlaps a set of {@link XuiAvatar}s into a stack. With max, only the first max avatars show and the rest collapse into a trailing +N avatar.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''maxnumberMaximum avatars to show before collapsing the rest into +N (0 = no limit).0shapeXuiAvatarVariants['shape']Shape/size applied to the trailing +N avatar.this.config.shapesizeXuiAvatarVariants['size']Size of every avatar in the group, including the overflow counter.this.config.size

XuiAvatar

componentxui-avatar

A compact user/entity representation: an image, text initials, or projected icon. Falls back to the text/icon when the image fails to load.

Variants

AxisOptionsDefaultshapecirclesquarecirclesizesmmdlgxlmd

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''srcstringImage URL. Falls back to text/projected content on load error.altstringAlternative text for the image, and the avatar's accessible name. Falls back to text when unset; leave both empty for a purely decorative avatar.''textstringInitials or short text shown when there is no image.shapeXuiAvatarVariants['shape']Round or square-cornered.this.config.shapesizeXuiAvatarVariants['size']Diameter, with the initials scaled to match.this.config.size

Source

libs/ui/avatar/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.