Description
An <sp-avatar>
is a great way to feature a visual representation of a user.
Usage
yarn add @spectrum-web-components/avatar
Import the side effectful registration of <sp-avatar>
via:
import '@spectrum-web-components/avatar/sp-avatar.js';
When looking to leverage the Avatar
base class as a type and/or for extension purposes, do so via:
import { Avatar } from '@spectrum-web-components/avatar';
Example
<sp-avatar label="Dog the User" src="https://placedog.net/500/500"></sp-avatar>
Accessibility
The label
attribute of the <sp-avatar>
will be passed into the <img>
element as the alt
tag for use in defining a textual representation of the image displayed.