Skip to content
synccn

Avatar

Image with initials fallback, presence dot and stacked groups.

MRJ
MRJ

Playground

Change the props and copy the code. The controls come from the component's TypeScript types.

M

Props

size
status
import { Avatar } from "@/components/ui/avatar";<Avatar name="Michael" />

Installation

$ pnpm dlx shadcn@latest add @synccn/avatar

First time in this project? Connect synccn with one command.

Usage

import { Avatar, AvatarGroup } from "@/components/ui/avatar";<Avatar name="Michael" status="online" />

API reference

Generated from the component's TypeScript types, so it always matches the code.

Avatar

Image with an initials fallback and an optional presence dot.

  • src
    string

    Image URL. Falls back to initials if missing or broken.

  • name
    string

    Person's name, used for initials, colour and alt text.

  • size
    "xs" | "sm" | "md" | "lg"

    Default "md"

    Diameter preset.

  • status
    "online" | "away" | "busy" | "offline"

    Shows a presence dot.

  • className
    string

    Extra classes for the root element.

AvatarGroup

  • peoplerequired
    { name: string; src?: string; status?: "online" | "away" | "busy" | "offline" }[]

    People to show.

  • max
    number

    Default 4

    Avatars shown before a “+N” bubble.

  • size
    "xs" | "sm" | "md" | "lg"

    Default "sm"

    Diameter preset for every avatar.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-label