Prodular UI

Avatar

A person or workspace image with an initials fallback, four sizes, a presence dot and overlapping groups.

npx prodular-ui add avatar

Sizes

xs 20px, sm 24px, default 32px, lg 40px. The fallback shows while the image loads or if it fails.

MMOMOMO

Group

Overlapping avatars with a count for the rest. The group sets the size for every child.

MODRPRTL
+3
MODRPRTL
+3
MODRPRTL
+3

Presence

AvatarStatus shows online, away, busy or offline and announces it to screen readers.

  • MO
    Maya OkaforSupport lead
    online
  • DR
    Daniel ReyesAccount executive
    away
  • HS
    Hana SatoSolutions engineer
    busy
  • OG
    Owen GallagherBilling
    offline

Anatomy

<Avatar>  <AvatarImage src="/maya.jpg" alt="Maya Okafor" />  <AvatarFallback>MO</AvatarFallback>  <AvatarStatus status="online" /></Avatar>

Guidance

Use it when

  • Show who owns, created or is assigned to something.
  • Use AvatarGroup to show who has access or who is viewing, capped at four or five faces.
  • Use AvatarStatus where presence changes what people do next, such as assigning a ticket.

Avoid

  • Avatars as the only label for a person. Show the name next to it, or in a tooltip.
  • Presence dots on lists where presence is not live.
  • Groups of more than five avatars. Show four and a count.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Always include AvatarFallback with one or two initials. Use one initial at size xs.
  • Give AvatarImage an alt with the person's full name.
  • Set size on AvatarGroup, not on each Avatar inside it.
  • End a group with AvatarGroupCount, labeled with aria-label, for example aria-label="3 more members".
  • Map presence with AvatarStatus status: online, away, busy, offline. Do not draw your own dot.
  • On a surface that is not a card, set [--avatar-ring:var(--color-background)] on a parent so the rings match the background.

API

Avatar

PropTypeDefaultDescription
size"xs" | "sm" | "default" | "lg""default"20, 24, 32 or 40px. Inherits from AvatarGroup.

AvatarGroup

PropTypeDefaultDescription
size"xs" | "sm" | "default" | "lg"Size for every avatar and the count in the group.

AvatarStatus

PropTypeDefaultDescription
status"online" | "away" | "busy" | "offline"Presence. Colored with success, warning, destructive or gray.
labelstringAccessible label. Defaults to the status name.

AvatarBadge

PropTypeDefaultDescription
childrenReactNodeA small primary badge at the bottom right, optionally with an icon.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add avatar# or, with the registry in components.jsonnpx shadcn@latest add @prodular/avatar