Skip to content

Avatar

The Avatar component displays an image or text in a flexible, scalable container. It is designed to easily integrate with other components, making it ideal for profile pictures, initials, or symbolic icons.

Example

Basic Avatar

This example demonstrates the basic usage of the Avatar component, displaying a custom background color and a single initial.

Avatar with Image

This example shows the Avatar component displaying an image. Even though the initial property is set, the image is rendered instead because it has a higher display priority.

Tile Shape Avatar

This example demonstrates the usage of the tile property, which allows the avatar to be displayed as a square rather than the default circular shape. The first avatar uses only the tile property, producing a fully square appearance without any corner rounding. The second avatar additionally uses the rounded property with a medium (md) value, resulting in a tile shape with rounded corners.

Props

PropertyTypeDefaultDescription
visiblebooleantrueControls whether the avatar is visible.
positionnumber[]0 0 0Sets the avatar’s position in 3D space.
sizeenum (small, medium, large)mediumSpecifies the size of the component.
opacitynumber1Specifies the opacity of the component.
colorstring (blue, #fff)#00BA92Defines the background color of the avatar.
textcolorstringblackSpecifies the color of the text displayed within the avatar. If the contrast with the background is insufficient, the text color will not be applied.
textstring""Specifies the text to be displayed inside the avatar.
imagestring""Specifies the image to be displayed inside the avatar.
tilebooleanfalseIf true, removes the circular shape and makes the avatar square. Can be used with the rounded property for custom border radius.
roundedenum (sm, md, lg)""Applies rounded corners to the avatar. Uses predefined sizes (sm, md, lg)