Avatar
Show a user's photo in a circle, with their initials when there's no photo or it fails to load.
Installation
This also adds Skeleton, which the avatar shows while the photo loads.
Usage
- A pulsing skeleton covers the circle until the photo loads.
- If the photo fails to load, for example when the device is offline, the avatar shows
fallbackinstead. srcmust be a PNG, JPEG, GIF, BMP or WebP image. Lynx's<image>doesn't load SVG files.
Initials only
Leave out src to show the fallback text on a muted circle. With neither, the circle is empty.
Sizes
size sets the diameter. The initials scale with it.
The sizes match Tailwind's h-8, h-10, h-14, h-20 and h-28, from sm to 2xl.
API
UiAvatar
No outputs.
