AR
TK
LW
DP
Installation
CLI
Install the component using the StarUI CLI:
Examples
Sizes
Override the default size-10 using Tailwind size utilities on the Avatar container
XS
SM
MD
LG
XL
2X
Image Error Fallback
AvatarFallback content appears when the image URL is broken or omitted
JC
Valid URL
DP
Broken URL
AR
No image
Status & Badges
Overlay status dots and notification counts using absolute positioning with accessible labels
SM
JC
AR
SM
Avatar Group
Stack avatars with negative spacing and ring borders via the data-slot selector
JC
SM
AR
TK
+3
User Profiles
Avatar paired with name and metadata in common layout patterns
JC
James Chen
AR
Ava Rodriguez
Engineering Lead
TK
Tom Kim
Last active 2 hours ago
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
cls |
str |
'' |
Additional CSS classes. Use Tailwind size utilities (size-6 through size-20) to override the default size-10 |
| Component | Description |
|---|---|
Avatar |
Root container. Renders as a rounded-full overflow-hidden flex container with data-slot='avatar' for parent-context selectors |
AvatarImage |
Image element with built-in error detection via Datastar signals. Props: src (str, required), alt (str), loading (str, default 'lazy'), signal (str | Signal) for external error state control |
AvatarFallback |
Displayed when no AvatarImage is provided or the image fails to load. Accepts any children — typically 1-2 character initials |