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
Reading list
Twelve items, three unread.
Kept by Maya Jacobsen
Variants
Assigned to Anya Lindqvist
States
New reply
Anya Lindqvistanya@example.com
+6
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
renderaround 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
imgas its first child instead.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/avatar.jsonimport { Avatar, AvatarImage, AvatarFallback, AvatarSilhouette, AvatarBadge, AvatarGroup, AvatarGroupCount } from "@/components/cobalt/ui/avatar"