For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
0
Sponsor

Avatar

An image element with a fallback for representing the user.

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

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.vercel.app/r/avatar.json

Usage

import {
  Avatar,
  AvatarFallback,
  AvatarImage,
} from "@/components/ui/avatar/avatar";
<Avatar>
  <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
  <AvatarFallback>CN</AvatarFallback>
</Avatar>

Composition

Use the following composition to build a Avatar:

Avatar
├── AvatarImage
└── AvatarFallback

RTL

To enable right-to-left support, see the RTL guide.

CNAP
"use client";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";
import {
  Avatar,

API Reference

See the Base UI documentation for the full API.