An avatar is a visual representation of a contact, user, or entity in Dialpad.
The component prioritizes different sources for content display, sequentially checking first for an image source (image-src) or content in the icon slot. If neither are provided, initials are extracted from the full name (full-name) using the following logic:
full-name: "Jaqueline Nackos" will result in: JN.full-name: "Jaqueline" will result in: JA.
full-name: "10" will result in: 10.| Type | Usage | |
|---|---|---|
| Icon | When no username can be associated with the Avatar. | |
DP | Initials | When the user's name is known. |
![]() | Image | When a custom image has been uploaded. |
![]() | Group | When reflecting more than 2 participants. |
<dt-avatar> <template #icon> <dt-icon-user /> </template> </dt-avatar>
Unless otherwise specified via the color prop, a background color will be provided based on the seed prop. This background is based on a hashed version of the user ID, allowing the colors to be consistent across sessions. Colors are dynamically computed using OKLCH and adapt to the current theme.
<!-- Use seed for consistent random colors per user --> <dt-avatar full-name="Daniel Parker" seed="user-unique-id" />
If image-src is not provided, or if image fails to load, the avatar will fall back to the initials extracted from the full-name.
<dt-avatar image-src="/assets/images/person.png" full-name="Daniel Parker" image-alt="avatar user" /> <dt-avatar image-src="/assets/images/broken-image.png" full-name="Daniel Parker" image-alt="avatar user" />
Avatar supports a 100-based sizing scale. T-shirt sizes (xs, sm, md, lg, xl) are deprecated but still supported as aliases.
| Size | Alias | Dimensions |
|---|---|---|
100 | xs | 16px |
150 | — | 20px |
200 | sm | 24px |
250 | — | 28px |
300 | md | 32px (default) |
400 | — | 40px |
500 | lg | 48px |
600 | xl | 64px |
700 | — | 96px |
800 | — | 128px |
900 | — | 256px |
<dt-avatar size="{size}"> <template #icon> <dt-icon-user /> </template> </dt-avatar>
The group avatar is used to represent group discussions in a compact form. A count badge is added on top of the avatar. The avatar shown is the last person to send a message in the group. The group avatar is available only from sizes 100-500. At size 100, only the count badge is shown.
<dt-avatar size="100" :group="3" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar size="150" :group="5" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar size="200" :group="12" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar size="250" :group="8" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar size="300" :group="24" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar size="400" :group="100" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar size="500" :group="7" image-src="/assets/images/person.png" image-alt="Person Avatar" />
Provides the user's current presence, positioned in the bottom right corner.
<dt-stack direction="row" align="center" gap="100"> <dt-avatar :size="100" presence="active" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar :size="200" presence="away" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar :size="300" presence="busy" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar :size="400" presence="dnd" image-src="/assets/images/person.png" image-alt="Person Avatar" /> <dt-avatar :size="500" presence="offline" image-src="/assets/images/person.png" image-alt="Person Avatar" /> </dt-stack> <dt-stack direction="row" align="center" gap="100"> <dt-avatar :size="100" presence="active" seed="user-1" full-name="Test Name" /> <dt-avatar :size="200" presence="away" seed="user-2" full-name="William Steele" /> <dt-avatar :size="300" presence="busy" seed="user-3" full-name="Frank Richard" /> <dt-avatar :size="400" presence="dnd" seed="user-4" full-name="John Hawkins" /> <dt-avatar :size="500" presence="offline" seed="user-5" full-name="Alice Edwards" /> </dt-stack>
<dt-avatar :size="400" image-src="/assets/images/person.png" image-alt="avatar user"> <template #overlayIcon> <dt-icon-hear /> </template> </dt-avatar> <dt-avatar :size="400" image-src="/assets/images/person.png" image-alt="avatar user" overlay-text="+3" />
Avatars that appear alongside a visible label (e.g., a user's name) are decorative and should not be focusable or announced by screen readers. This is the default behavior.
Avatars that convey meaning on their own — such as navigation or actions — should be made interactive using the interactive prop. This renders the avatar as a <button> with visible focus ring and keyboard activation via Enter and Space. Provide an accessible name via icon-aria-label (for icon avatars), full-name (for initials avatars), or image-alt (for image avatars).
<dt-avatar interactive icon-aria-label="user"> <template #icon> <dt-icon-user /> </template> </dt-avatar>
Use the deactivated prop to render the avatar in a desaturated/washed-out state. This is useful to indicate that a user is deactivated or inactive.
<dt-avatar deactivated image-src="/assets/images/person.png" image-alt="Deactivated user" /> <dt-avatar deactivated full-name="Deactivated User" seed="user-deactivated" /> <dt-avatar deactivated> <template #icon> <dt-icon-user /> </template> </dt-avatar>
Initials avatars use background and text color pairings that meet WCAG AA minimum contrast requirements. Variants 0–5 use light text on dark backgrounds, and variants 6–9 use dark text on light backgrounds.
The deactivated prop applies a visual desaturation effect that is not conveyed to screen readers. If the deactivated status is meaningful, communicate it through surrounding text or an aria-label on a parent element.
The group count badge includes role="img" and an aria-label (e.g., "3 participants") so screen readers announce the participant count with context rather than reading the raw number.
For more guidance, see the WCAG images tutorial.
import { DtAvatar } from '@dialpad/dialtone-vue';
Name
|
Type
|
|---|---|
icon | Slot for avatar icon. It will display if no imageSrc is provided |
overlayIcon | Slot for overlay icon. |
Name
|
Default
|
Type
|
|---|---|---|
avatarClass | '' | string|array|object Used to customize the avatar container |
canvasClass | '' | string|array|object Set classes on the avatar canvas. Wrapper around the core avatar image. |
deactivated | false | boolean When true, renders the avatar in a desaturated/washed-out state.
Use this to indicate that a user is deactivated or inactive. |
family |
"1"
|
"2"
|
"3"
|
"4"
|
"5"
|
"6"
|
"7"
|
"8"
|
"9"
|
"10"
|
"11"
|
"12"
Advanced. Avatar color family (1-12). Each family represents a different hue
offset from the theme's anchor. Only use this if you need explicit control over
the color. For most cases, use | |
fullName | '' | string Full name used to extract initials. |
group | number Determines whether to show a group avatar.
Limit to 2 digits max, more than 99 will be rendered as "99+".
if the number is 1 or less it would just show the regular avatar as if group had not been set. | |
iconAriaLabel | string Descriptive label for the icon.
To avoid a11y issues, set this prop if clickable and iconName are set. | |
iconClass | '' | string|array|object Pass through classes. Used to customize the avatar icon |
iconOnly | false | boolean When true, renders the avatar with a transparent background and no color.
Useful for displaying icons that should not have a colored background,
such as channel or navigation icons. |
id | generated unique ID | string Id of the avatar content wrapper element |
imageAlt | string Alt attribute of the image, required if imageSrc is provided.
Can be set to '' (empty string) if the image is described
in text nearby | |
imageSrc | '' | string Source of the image |
interactive | false | boolean Makes the avatar focusable and interactive,
emits a click event when clicked. |
overlayClass | '' | string|array|object Used to customize the avatar overlay |
overlayText | '' | string The text that overlays the avatar |
presence | null |
"null"
|
"busy"
|
"away"
|
"offline"
|
"active"
|
"dnd"
Determines whether to show the presence indicator for
Avatar - accepts PRESENCE_STATES values: 'busy', 'away', 'offline',
'active', or 'dnd'. By default, it's null and nothing is shown. |
presenceProps | {} | object A set of props to be passed into the presence component. |
seed | string Recommended. Pass a unique identifier (e.g., user ID) to generate consistent,
deterministic colors for this avatar. The same seed always produces the same color.
This is the preferred approach for most use cases. | |
size | 300 |
"100"
|
"150"
|
"200"
|
"250"
|
"300"
|
"400"
|
"500"
|
"600"
|
"700"
|
"800"
|
"900"
The size of the avatar.
T-shirt sizes (xs, sm, md, lg, xl) are deprecated and will be removed in the next major version.
Please use the numeric scale instead. |
variant |
"0"
|
"1"
|
"2"
|
"3"
|
"4"
|
"5"
|
"6"
|
"7"
|
"8"
|
"9"
Advanced. Avatar color variant (0-9). Controls lightness/chroma within the family.
Only use this if you need explicit control over the color. For most cases, use | |
clickable Deprecated | null | boolean Use interactive instead. |
color Deprecated | string Avatar color code for backward compatibility. Converted internally
to family/variant. For new code, use Use seed or family/variant instead. |
Name
|
Type
|
|---|---|
click | PointerEvent | KeyboardEvent Avatar click event |
Class
|
Applies to
|
Description
|
|---|
Avatar documentation last updated Friday, September 4, 2026
fix/popover-modal-zindex-scope