Components
← All components

Avatar

stimeo--avatar

Shows a user image and swaps to a fallback when it fails to load.

The stimeo--avatar controller has no dedicated APG pattern; it follows the non-text-content practice (WCAG 1.1.1). It watches the inner <img> for load and error and swaps to the author-provided fallback when the image fails or no src is given, exposing the loading / loaded / error phase on data-state. The accessible name lives on the container (role="img" + aria-label) while the <img> and the fallback are aria-hidden, so assistive tech reads the name once regardless of which side is visible. Behavior only — shape, size, and colour are owned by this Playground; initials or colour generation are out of scope.

running
Loads successfully (image shown)
Load fails → initials (the console 404 is intentional)