Avatar
Display user profile images with fallback initials, status indicators, and grouping support.
Installation
You can add this component using our CLI or manually:
$npx omnira-ui@latest add avatar
Sizes
Six sizes from xs (24px) to 2xl (72px).
Sizes
Fallback
When no image is provided, initials from alt text or a custom fallback are shown.
Fallback
OR
JD
?
Shapes
Circle (default) and rounded square shapes.
Shapes
Status Indicator
Show online, away, busy, or offline status with a colored dot.
Status
Avatar Group
Stack avatars with overlap. Use max to limit visible count with a +N overflow.
Group
+2
Usage
Import Avatar and AvatarGroup.
tsx
import { Avatar, AvatarGroup } from "@/components/ui/Avatar";
// Basic
<Avatar src="/avatar.jpg" alt="Olivia Rhye" size="md" />
// Fallback
<Avatar alt="Olivia Rhye" size="md" />
// Status
<Avatar src="/avatar.jpg" size="lg" status="online" />
// Group with overflow
<AvatarGroup size="md" max={3}>
<Avatar src="/a1.jpg" size="md" />
<Avatar src="/a2.jpg" size="md" />
<Avatar src="/a3.jpg" size="md" />
<Avatar src="/a4.jpg" size="md" />
</AvatarGroup>Avatar Props
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | — | Image URL. |
| alt | string | — | Alt text (also used for initials fallback). |
| fallback | string | — | Custom fallback text (overrides initials). |
| size | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "md" | Avatar size. |
| shape | "circle" | "rounded" | "circle" | Avatar shape. |
| status | "online" | "offline" | "away" | "busy" | — | Status indicator dot. |
AvatarGroup Props
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| max | number | — | Max visible avatars. Overflow shows +N. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "md" | Size for overflow indicator. |