Skip to content
Components

Avatar

Profile image with initials fallback and composable overlapping groups.

Composition

Avatar group

  • <AvatarGroup>
    • <Avatar>
      • <AvatarImage />
      • <AvatarFallback />
      • <AvatarBadge />
      </Avatar>
    </AvatarGroup>

Installation

The Control UI source installs this primitive from src/registry/sources/control-ui/ui/avatar.tsx.

Registry command
See registry manifest

Raw code

Primary installed source

src/registry/sources/control-ui/ui/avatar.tsx

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-avatar-* · 10 knobsHow the cascade resolves
--cui-avatar-radius<length-percentage>9999px
--cui-avatar-group-ring-color<color>var(--background)
--cui-avatar-fallback-background<color>var(--muted)
--cui-avatar-fallback-foreground<color>var(--muted-foreground)
--cui-avatar-image-outline-color<color>var(--image-outline)
--cui-avatar-badge-size<length-percentage>max(0.5rem, 30%)
--cui-avatar-badge-ring-size<length-percentage>2px
--cui-avatar-badge-ring-color<color>var(--background)
--cui-avatar-badge-background<color>var(--primary)
--cui-avatar-badge-foreground<color>var(--primary-foreground)