Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
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...
Dropdown Menu
Loading...
Group Count
Loading...
Group
Loading...
Profile
Loading...
Sizes
Loading...
Variants
Loading...
With Tooltip
Loading...
API Reference
<app-avatar>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
size | "default" | "sm" | "lg" | "xs" | "xl" | "default" | Sets the avatar size. |
shape | "round" | "square" | "round" | Sets the avatar shape. |
id | string | undefined | generated | Unique identifier used to connect the avatar parts. |
ids | Partial<AvatarElementIds> | undefined | — | Overrides generated identifiers for individual parts. |
Outputs
| Output | Type | Description |
|---|---|---|
statusChange | AvatarStatusChangeDetails | Emits when the image loading status changes. |
Context, Provider, and Utilities
| Export | Angular API |
|---|---|
AvatarRootProvider | Directive that provides an externally created avatar API through value. |
AvatarContext | Structural 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. |
AvatarImports | Readonly collection containing all avatar components and context helpers. |
Types
| Export | Description |
|---|---|
AvatarApi | Connected avatar state and actions. |
AvatarElementIds | Overrides for generated avatar part IDs. |
AvatarLoadStatus | Possible image loading states. |
AvatarMachineProps | Configuration accepted by the avatar machine. |
AvatarService | Avatar state-machine service. |
AvatarStatusChangeDetails | Details emitted by statusChange. |
UseAvatarOptions | Options accepted by useAvatar. |
UseAvatarProps | Properties used to create the avatar machine. |
UseAvatarReturn | Signal-backed value returned by useAvatar. |
Angular
React
Solid
Svelte
Vue