Avatar

Avatar displays an image, icon, or custom content inside a geometric mask with optional status indicator. Supports many shapes via boolean props or a shape string prop. Automatically adjusts foreground color for contrast based on the background color prop, ensuring content remains visible regardless of background.

Basic Example

Code Example
Basic.vue

Avatar

Renders content (image, icon, initials, etc.) inside a shaped mask. You can control the background color, mask shape, and optionally show an online status indicator. The component automatically computes a contrasting foreground color for accessibility and legibility.

Avatar Props Type Description
presence
string

Shows a status indicator based on one of the following prop names:

   
online
boolean

If true, displays the avatar as online.

   
offline
boolean

If true, displays the avatar as offline.

backgroundColor
string

Sets the background color of the avatar as a CSS color (not a class utility). The component automatically computes a contrasting foreground text color for content legibility.

maskClasses
string

Additional classes to apply to the mask element.

shape
string

Sets the shape of the avatar mask. Equivalent to setting one of the below boolean props.

   
squircle
boolean

Sets shape to "squircle"

   
heart
boolean

Sets shape to "heart"

   
hexagon
boolean

Sets shape to "hexagon"

   
hexagon2
boolean

Sets shape to "hexagon-2"

   
decagon
boolean

Sets shape to "decagon"

   
pentagon
boolean

Sets shape to "pentagon"

   
diamond
boolean

Sets shape to "diamond"

   
square
boolean

Sets shape to "square"

   
circle
boolean

Sets shape to "circle"

   
star
boolean

Sets shape to "star"

   
star2
boolean

Sets shape to "star-2"

   
triangle
boolean

Sets shape to "triangle"

   
triangle2
boolean

Sets shape to "triangle-2"

   
triangle3
boolean

Sets shape to "triangle-3"

   
triangle4
boolean

Sets shape to "triangle-4"

   
half1
boolean

Sets shape to "half-1"

   
half2
boolean

Sets shape to "half-2"

Avatar Slots Description
default

The default slot. Content to be masked and displayed inside the avatar (image, icon, initials, etc.).

AvatarGroup

Groups multiple Avatar components together in a horizontal or vertical layout. Useful for displaying teams, user lists, or overlapping avatars.

AvatarGroup Props Type Description
orientation
string

Sets the layout direction of the group. Accepts horizontal or vertical. Defaults to horizontal if not specified.

   
horizontal
boolean

If true, arranges avatars in a horizontal row. Overrides orientation if both are set.

   
vertical
boolean

If true, arranges avatars in a vertical column. Overrides orientation if both are set.

AvatarGroup Slots Description
default

The default slot. Place your Avatar components here to group them visually.

Examples

Mask

Showcases all available mask shapes. Use the shape prop or boolean mask props to change the avatar shape.

squircle
heart
hexagon
hexagon-2
decagon
pentagon
diamond
square
circle
star
star-2
triangle
triangle-2
triangle-3
triangle-4
Code Example
Mask.vue

Mask Ring

Demonstrates a ring around the avatar using mask shapes. Useful for status or focus indication.

Code Example
MaskRing.vue

Mask Ring Layered

Displays a layered ring effect around the avatar.

Code Example
MaskRingLayered.vue

Placeholders

Shows how to use fallback content (like initials or icons) when no image is provided.

Vanessa
MT
Code Example
Placeholders.vue

Presence

Demonstrates online/offline status indicators with the online and offline props. You can also use the presence prop to set the status to either online or offline.

Code Example
Presence.vue

Avatar Ring

A simple ring effect around the avatar, without additional mask layers.

Code Example
Ring.vue

Avatar Ring With Mask

Combines ring and mask shape for advanced avatar styling.

Code Example
RingWithMask.vue

Avatar Size

Showcases different avatar sizes.

w-6
w-10
w-16
w-24
w-36
Code Example
Size.vue