Getting StartedInstall and bootstrap headless foundations 4
FormHeadless input and selection contracts 19
LayoutHeadless structural primitives for expandable and container patterns 6
NavigationHeadless trails, trees, menus, and command surfaces 7
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
UtilityReusable action, identity, and clipboard behavior 6

API reference

The headless Avatar primitive is intentionally small. It gives you stable slot markers and nothing more: no inputs, no outputs, and no built-in fallback behavior.

Directives

Use the host directive on any wrapper element, the image directive on an img, and the fallback directive on any element that should appear when the image is unavailable.

Supported selectors

html
<span tngAvatar></span>
<img tngAvatarImage />
<span tngAvatarFallback></span>

Slot contract

DirectiveSelectorReflected hookPurpose
TngAvatar[tngAvatar]data-slot="avatar"Avatar frame or host element.
TngAvatarImageimg[tngAvatarImage]data-slot="avatar-image"Image node for the visual source.
TngAvatarFallback[tngAvatarFallback]data-slot="avatar-fallback"Fallback initials, icon, or decorative surface.

Owner responsibilities

You decide when fallback is visible, what alt text is used, and how the avatar is sized or shaped. The primitive does not manage image-error state, hidden toggling, or initials.

Manual fallback state

ts
protected readonly src = signal<string | null>(profileUrl);
protected readonly imageLoadFailed = signal(false);

protected showFallback(): boolean {
  return this.src() === null || this.imageLoadFailed();
}