Skip to content

Avatar - Web Component

...

Browser support

Parameters

The Web component uses a <z-avatar> tag.

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescription
layoutstring

Custom attribute for the article card component. Possible values are: horizontal, vertical or dropdown

configstringThe configuration of the profile
image-srcstringThe URL of the image for the profile
initialsstringThe initials of the user profile
statusstringThe status of the user profile
badgeobjectThe badge for the profile
dropdown-elementsarrayThe dropdown elements in case layout is dropdown
contentstringThe content of the user profile
namestringThe name of the user profile

Playground

Customization

HTML Examples

Imports
html
<link rel="stylesheet" href="/0.3.7/@zurich/web-components/styles.css" />
<script type="module" src="/0.3.7/@zurich/web-components/avatar.js"></script>
Code
html
<z-avatar config="m" image-src="/0.3.7/sample.png" initials="AZ" layout="horizontal"
  badge="{ config:'text:xs', text:'1', 'z-color: 'peach' }" name="User name" content="Description">
</z-avatar>