Avatar
Data Displayatlas-avatarExamples
Image, fallback and sizes
src shows the image; without it, or when it fails to load, the avatar shows initials from alt (first and last name) or a custom fallback . size is sm , md (default) or lg .
Accessible name
Like an <img> : alt is the person's name for screen readers whether the image or the initials show. Without alt the avatar is decorative — use that when the name is written next to it, so it is read once.
Avatar only, named "Grace Hopper" Ada Lovelace
Sizes and image fallback
size takes sm , md or lg . When src is missing or fails to load, the avatar shows the initials from fallback (or from alt ) instead of a broken image.
API
Generated from the library source, so it always matches the code.
AtlasAvatarComponent atlas-avatar
| Input | Type | Default | Description |
|---|---|---|---|
| src | string | null | null | fallback or alt ) show instead. |
| alt | string | '' | alt , the fallback's accessible name, and the source of the initials. Leave it empty when the name is written next to the avatar: it is then decorative. |
| fallback | string | '' | alt (for example "JD"). |
| size | 'sm' | 'md' | 'lg' | 'md' | sm , md or lg . |
| class | string | '' | cn() ; yours win on conflicts. |