Avatar

PreviousNext

An image element with fallbacks for representing the user.

Docs
bunduicomponent

Preview

Loading preview…
examples/components/avatar/sizes/page.tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";

export default function AvatarSizes() {
  return (
    <div className="flex items-center gap-2">
      <Avatar>
        <AvatarImage src="https://www.tobybelhome.com/user.png" alt="@shadcn" />
        <AvatarFallback>CN</AvatarFallback>
      </Avatar>
      <Avatar className="size-10">
        <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
        <AvatarFallback>CN</AvatarFallback>
      </Avatar>
      <Avatar className="size-12">
        <AvatarImage
          src="https://images.unsplash.com/photo-1654110455429-cf322b40a906?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTB8fGF2YXRhcnxlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&q=60&w=300"
          alt="@shadcn"
        />
        <AvatarFallback>CN</AvatarFallback>
      </Avatar>
    </div>
  );
}

Installation

npx shadcn@latest add @bundui/avatar-sizes

Usage

import { AvatarSizes } from "@/components/avatar-sizes"
<AvatarSizes />