Search documentation

Search the documentation and open a page.

An image element with a fallback for representing the user.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/avatar

Composition

[app-avatar-group] (optional) ├── <app-avatar> │ ├── <img app-avatar-image> │ ├── [app-avatar-fallback] │ └── [app-avatar-badge] (optional) └── [app-avatar-group-count] (optional)

Examples

Badge

Loading...

Default

Loading...
Loading...

Group Count

Loading...

Group

Loading...

Profile

Loading...

Sizes

Loading...

Variants

Loading...

With Tooltip

Loading...

API Reference

<app-avatar>

Inputs

InputTypeDefaultDescription
size"default" | "sm" | "lg" | "xs" | "xl""default"Sets the avatar size.
shape"round" | "square""round"Sets the avatar shape.
idstring | undefinedgeneratedUnique identifier used to connect the avatar parts.
idsPartial<AvatarElementIds> | undefined—Overrides generated identifiers for individual parts.

Outputs

OutputTypeDescription
statusChangeAvatarStatusChangeDetailsEmits when the image loading status changes.

Context, Provider, and Utilities

ExportAngular API
AvatarRootProviderDirective that provides an externally created avatar API through value.
AvatarContextStructural directive [avatar-context] exposing the avatar API to a template.
useAvatar(options)Creates the signal-backed avatar machine inside an Angular injection context.
injectAvatarContext()Injects the nearest avatar context.
AvatarImportsReadonly collection containing all avatar components and context helpers.

Types

ExportDescription
AvatarApiConnected avatar state and actions.
AvatarElementIdsOverrides for generated avatar part IDs.
AvatarLoadStatusPossible image loading states.
AvatarMachinePropsConfiguration accepted by the avatar machine.
AvatarServiceAvatar state-machine service.
AvatarStatusChangeDetailsDetails emitted by statusChange.
UseAvatarOptionsOptions accepted by useAvatar.
UseAvatarPropsProperties used to create the avatar machine.
UseAvatarReturnSignal-backed value returned by useAvatar.