Avatar

A round picture of a person, with initials on the macOS contact gradient as a fallback.

Installation

pnpm dlx shadcn@latest add @cupertinoui/avatar

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"

<Avatar>
  <AvatarImage src="/john.jpg" alt="John Appleseed" />
  <AvatarFallback>JA</AvatarFallback>
</Avatar>

API Reference

Every part forwards the props of the underlying Base UI Avatar part. The props below are the ones CupertinoUI adds or changes.

Avatar / AvatarImage / AvatarFallback

PropTypeDescription
classNamestringExtra classes, merged with the component's own.