Skip to content
HomeCobalt

Avatar

Shows who someone is: their picture, or the same silhouette for everyone without one, named once by the root or hidden when the name sits beside it.

Examples

Members of a shared list, each row a link to the person's profile, with the avatar beside the name and read once.
In a cardThe list's owner at the head of a card.
Reading list
Twelve items, three unread.
Kept by Maya Jacobsen

Variants

Assigned to Anya Lindqvist
Small24px, inline beside a name in a line of text, with the fallback's text one step smaller.
Large40px, at the head of a profile, a card or a dialog.

States

New reply
BadgedA square accent mark for something new from this person, with the words beside it.
Anya Lindqvistanya@example.com
DecorativeBeside the same name, so a screen reader hears it once.
  • Anya Lindqvist
    anya@example.com
  • Gwen Holloway
    gwen@example.com
  • Kira Jensen
    kira@example.com
FallbackIn a list where some people have no picture, each of them gets the same silhouette.
+6
GroupedOverlapped by 8px, ringed in the page colour, then a count.

Usage

Use it when

  • A row, a comment or a list item belongs to a person, and a face finds them faster than a name.
  • A set of people share a thing, and the row shows who, with a count for the rest.

Use something else when

  • The mark names a thing, such as a workspace or a project. Use Tag instead, which takes its hue from the key.
  • The avatar would be a button, such as a menu trigger. Use Button with render around the avatar instead, so the control has a role and a name.
  • The picture is content, such as a photo in a card. Use Card with an img as its first child instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/avatar.json
import { Avatar, AvatarImage, AvatarFallback, AvatarSilhouette, AvatarBadge, AvatarGroup, AvatarGroupCount } from "@/components/cobalt/ui/avatar"