8.4k

Avatar

An image element with a fallback for representing the user.

API Reference

Installation

pnpm dlx shadcn@latest add https://coss.com/ui/r/avatar.json

Usage

import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
<Avatar>
  <AvatarImage src="/avatars/01.png" alt="User avatar" />
  <AvatarFallback>JD</AvatarFallback>
</Avatar>

Examples

Fallback Only

Different Sizes

Different Radius

Group Avatars

Comparing with Radix / shadcn

If you’re already familiar with Radix UI and shadcn/ui, this guide highlights the small differences and similarities so you can get started with coss.com ui quickly.

Quick Checklist

  • If you used asChild on parts, switch to the render prop

coss.com ui

Built by and for the team of Cal.com, Inc. — the leading commercial open source company (“coss”).