Avatar
Terminal-inspired avatar with image support, monospace initials fallback, and group stacking with overflow.
Installation
dgadd ships in @diffgazer/add on npm: pnpm add -D @diffgazer/add puts it on pnpm exec, and npx @diffgazer/add runs it without the install.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS from the installed package.
Usage
Examples
Sizes
Group with Overflow
API Reference
Avatar
AvatarImage
AvatarFallback
AvatarGroup
AvatarIndicator
Accessibility
Notes
Image Fallback
When src fails to load, Avatar falls back to the fallback initials. If no fallback is provided, '?' is shown.
Terminal Style
Square shape with a border and monospace font for initials — following the @diffgazer/ui terminal-inspired aesthetic.
Spacing
AvatarGroup supports spacing='overlap' (default, stacked look) or spacing='gap' (spaced apart). Use 'gap' inside Select triggers or inline layouts where overlap looks cramped.
Composition
Avatar works standalone or inside AvatarGroup. Combine Avatar with public Select parts to build avatar pickers.
Source
Install via CLI: pnpm exec dgadd add ui/avatar. Keyboard hooks are included as standalone copies. For the full experience, use --integration keys.
Highlighted source loads after this disclosure opens. Browse the source repository.