An avatar is a visual representation of a user or object.

Preview

Usage

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:

  • If the string contains two or more words, the result will be the first character of the first and last word capitalized. E.g.: full-name: "Jaqueline Nackos" will result in: JN.
  • If the string contains only one word, the result will be the first two characters capitalized. E.g: full-name: "Jaqueline" will result in: JA. full-name: "10" will result in: 10.
  • If full-name is not provided, the result will be an empty string.
Type Usage
Icon When no username can be associated with the Avatar.
DP
Initials When the user's name is known.
user avatar
Image When a custom image has been uploaded.
person avatar
3
Group When reflecting more than 2 participants.

Variants and Examples

Icon

Initials

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.

Image

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.

Sizes

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

Group

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.

Presence

Provides the user's current presence, positioned in the bottom right corner.

Overlay

Interactive

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).

Deactivated

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.

Vue API

import { DtAvatar } from '@dialpad/dialtone-vue';

Slots

Name
Type
icon

Slot for avatar icon. It will display if no imageSrc is provided

overlayIcon

Slot for overlay icon.

Props

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 seed instead. Families: 1=Red, 2=Orange, 3=Amber, 4=Yellow-Green, 5=Green, 6=Teal, 7=Cyan, 8=Blue, 9=Indigo, 10=Purple, 11=Magenta, 12=Pink

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 seed instead. 0 = darkest, 9 = lightest. Variants 0-5 have light text, 6-9 have dark text.

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 seed (recommended) or family/variant. Format: family (1-12) * 100 + variant (0-9) * 10, e.g., '540' = family 5, variant 4.

Use seed or family/variant instead.

Events

Name
Type
click
PointerEvent | KeyboardEvent

Avatar click event

Classes

Class
Applies to
Description

Accessibility

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.

Avatar documentation last updated Thursday, June 18, 2026