Avatar
@/components/kamod-ui/avatar
CN
ER
CN
LR
ERInstallation
Import Avatar primitives from `@/components/kamod-ui/avatar`.
pnpm add @kamod-ch/uiimport { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "@/components/kamod-ui/avatar";Usage
Place AvatarImage and AvatarFallback inside Avatar. The fallback stays visible until the image fires load; on error it shows again.
import { Avatar } from "@/components/kamod-ui/avatar";<Avatar />
CNBasic
Image plus fallback initials.
CNBadge
AvatarBadge sits at the bottom-inline-end (logical end), overlaps the photo, and uses a thick white ring so the status dot reads clearly—same stacking as typical chat “online” indicators.
CNBadge with icon
Put an icon inside the badge; small avatars hide inner SVG to save space.
CNAvatar group
Overlap avatars with ring separation using AvatarGroup.
CN
LR
ERAvatar group count
Append AvatarGroupCount for overflow (+N).
CN
LR
ERGroup count with icon
Use an icon inside the count bubble (e.g. plus).
CN
LR
ERSizes
Use the size prop on Avatar (sm, default, lg).
CN
CN
CNDropdown
Use a ghost icon button as the dropdown trigger wrapping Avatar.
API Reference
Component overview.
Avatar
Root container; size maps to data-size for badge scaling.
| Prop | Type | Default |
|---|---|---|
| size | "sm" | "default" | "lg" | "default" |
| class | string | - |
AvatarImage
| Prop | Type | Default |
|---|---|---|
| src | string | - |
| alt | string | "" |
| class | string | - |
AvatarFallback
| Prop | Type | Default |
|---|---|---|
| class | string | - |
AvatarBadge
| Prop | Type | Default |
|---|---|---|
| class | string | - |
AvatarGroup
| Prop | Type | Default |
|---|---|---|
| class | string | - |
AvatarGroupCount
| Prop | Type | Default |
|---|---|---|
| class | string | - |
Accessibility Notes
Use Avatar with clear labels, keyboard-friendly interactions and semantic structure.