Avatar
User avatar with image or initials fallback, optional status dot, and size/shape variants.
primitive avatar
Controls
initials
size
shape
status
tone
Current props
initials: ""size: ""shape: ""status: ""tone: ""
Usage
// with image
primitive.Avatar(primitive.AvatarProps{Src: "/img/user.jpg", Alt: "Alice", Size: token.MD})
// initials fallback with tone
primitive.Avatar(primitive.AvatarProps{Initials: "AB", Tone: token.ToneCyan, Status: primitive.AvatarOnline})
// square shape
primitive.Avatar(primitive.AvatarProps{Initials: "BC", Shape: primitive.AvatarSquare, Tone: token.ToneViolet})All combinations (192)
Enum controls only · bool and text use defaults
Props
| Name | Type | Options | Default |
|---|---|---|---|
initials | text | — | MR |
size | enum | sm, md, lg, xl | md |
shape | enum | , square | |
status | enum | , online, away, offline | online |
tone | enum | , cyan, violet, lime, pink, yellow | cyan |