Skip to content
Star

Avatar

A unified avatar component that displays a person's initials or photo. Colors are automatically derived from the name via a hash function for consistent per-person coloring.

Interactive Playground

PlaygroundInteractive
Size:
Shape:
LK
Luis Kern

Initials (Basic)

Demo
AG
LM
SK
CR

Sizes

Sizes
AG
sm
LM
md
SK
lg
CR
xl

Square Shape

Square
AG
LM
SK
With Label
AG
Ana García
LM
Luis Martínez
SK
Sofia Kim

Image Source

With Image
Ana García
Luis Martínez
Fallback User

API Reference

PropTypeDefaultDescription
name
string | nullnullName used to generate initials and as tooltip/alt text
src
string | nullnullImage URL — takes priority over initials when provided
size
"sm" | "md" | "lg" | "xl""md"Size preset
shape
"circle" | "square""circle"Shape of the avatar
color
string | "auto""auto"Auto-color from name hash, or a custom CSS color string
label
booleanfalseOptional footer label (shows the full name below the avatar)

Deprecated Components

PxInitialsAvatar is kept for backward compatibility but internally delegates to PxAvatar. Migrate when convenient:

diff
- import { PxInitialsAvatar } from 'praxis-vue-ui'
+ import { PxAvatar } from 'praxis-vue-ui'

- <PxInitialsAvatar name="Alice Johnson" size="xlarge" />
+ <PxAvatar name="Alice Johnson" size="xl" />

Built with VitePress