Avatar
Show a person or resource image with a fallback while the image loads.
Use Avatar where a person or resource needs a compact identity cue. Supply a meaningful alt for identity images; the fallback remains visible until the image loads.
Basic usage#
Playground#
Anatomy#
Usage#
Image fallbacks#
Provide useful alt text for an image that conveys identity. When the image cannot load, the component can fall back to supplied text or initials; the application remains responsible for choosing an unambiguous accessible name.
Avatar renders the real <img src> during server rendering and uses native image load and error events to switch between image and fallback. Status is loading, loaded, or error.
Loading status#
Use image loading and error callbacks when surrounding UI needs to respond to a changed source status.
Examples#
Fallback modes#
Loading status#
Badge and group composition#
Attributes#
data-statusSlot: avatar, avatar-image, avatar-fallbackDescription: Stores async loading, loaded, or error status.Props#
Props for the Avatar component. Renders a <span> element by default.