Avatar

The avatar displays a reprensation of a user account in the platform. It adapts to the input, and displays the most fuitful content. It will sort in descending order between the folowing parameters.

  • User image
  • User icon
  • User initials (calculated form name)

I'ts benificial for the user if you always provide the full name of the user, since it will be providing screen readers with vital information.

Image

Cookie Monster

<!-- avatar.blade.php -->
    <div id="61efa8e601ea9" class="c-avatar c-avatar--size-md" data-uid="61efa8e601ea5">
                    <img src="https://picsum.photos/70/70?image=64" class="c-avatar__image" alt="Cookie Monster" aria-label="Cookie Monster"/>
        
        
            </div>
@avatar(
    [
        'image' => "https://picsum.photos/70/70?image=64",
        'name' => "Cookie Monster"
    ]
)
@endavatar

Name

CM

<!-- avatar.blade.php -->
    <div id="61efa8e6020dc" class="c-avatar c-avatar--size-md" data-uid="61efa8e6020d8">
        
        
                    <svg class="c-avatar__initials" aria-label="Cookie Monster" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
                <text font-size="380" y="50%" x="50%" fill="#fff" dominant-baseline="middle" text-anchor="middle" alignment-baseline="central">CM</text>
            </svg>
            </div>
@avatar(
    [
        'name' => "Cookie Monster"
    ]
)
@endavatar

Icon

favorite

<!-- avatar.blade.php -->
    <div id="61efa8e602332" class="c-avatar c-avatar--size-md" data-uid="61efa8e60232d">
        
                    <span class="c-avatar__icon" aria-label="Cookie Monster">
                <!-- icon.blade.php -->
    <i id="61efa8e6023e6" class="c-icon c-icon--size-xl c-icon--size-inherit material-icons" translate="no" role="img" alt="" data-uid="61efa8e6023e0">
                    favorite
            </i>
            </span>
        
            </div>
@avatar(
    [
        'name' => "Cookie Monster",
        'icon' => [
            'name' => 'favorite',
            'size' => 'xl'
        ]
    ]
)
@endavatar

Blade component parameters

Key Default value Type Available values Description
image string - A url to a profile image.
icon [] array - Attributes for @icon component (separate reference).
name string - Persons full name
size md string - sm,md,lg,full
id string - The DOM id of the component.
classList [] array - Array containing wrapping classes array
attributeList [] array - Array containing keys and values rendered as attributes
containerAware false boolean true/false Makes the component container aware. Appends modifiers --size--xs/sm/md/lg to the component.
Settings location: /mnt/persist/www/docroot_styleguide_v2/source/library/source/php/Component/Avatar/avatar.json