Avatar overview
<tng-avatar> wraps the headless avatar slots with built-in fallback handling, default sizing, and a minimum visual shell.
Imports
Use the wrapper when you want the library’s default avatar shell instead of managing fallback logic yourself.
Wrapper import
ts
import { TngAvatarComponent } from '@tailng-ui/components';
Minimal wrapper usage
html
<tng-avatar
[src]="profilePhotoUrl"
fallback="Tail Ng"
alt="Taylor Nguyen"
shape="circle"
size="md"
></tng-avatar>
Style variants
The wrapper keeps fallback behavior and slot wiring while you own surrounding composition.
Wrapper avatar (Plain CSS)
source mode: valid
Wrapper avatar (Tailwind CSS)
source mode: valid
Accessibility baseline
- Use meaningful
alttext when the avatar identifies a person. - Use
alt=""for decorative avatars when nearby text already names the person. - The wrapper automatically switches to fallback text when
srcis empty or the image fails to load.