Avatar

A component for displaying user avatars that supports both image and fallback states. Implements intelligent loading strategies and fallback handling for optimal user experience.

Provides fallback part if no image is available or it can't be loaded

Architecture

so-avatar

Reference

  • Avatar

    The container component that manages the display of either an image or fallback content. Handles image loading states and coordinates the presentation of the avatar system.

    • Attributes

      • alt
        string
        /
        default: -

        Alternative text description of the image for accessibility purposes. Should provide a meaningful description of the avatar.

      • name
        string
        /
        default: -

        Represents the user's name. If no image is provided, this value is used to generate initials for the fallback display.

      • size
        enum
        /
        default: md

        Determines the size of the avatar. The default size is md.

      • src
        string
        /
        default: -

        The URL of the avatar image to be displayed.

made for toddle