Hero Ui

Avatar

Component 5

About

Display user profile images with customizable fallback content.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Avatar to your project and fits it to your theme.

Code

How Avatar is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Avatar } from "@/components/ui/heroui-avatar";

export default function AvatarColorsDemo() {
  return (
    <div className="flex min-h-screen w-full items-center justify-center overflow-hidden bg-background p-8">
      <div className="flex items-center gap-4">
        <Avatar color="default">
          <Avatar.Fallback>DF</Avatar.Fallback>
        </Avatar>
        <Avatar color="accent">
          <Avatar.Fallback>AC</Avatar.Fallback>
        </Avatar>
        <Avatar color="success">
          <Avatar.Fallback>SC</Avatar.Fallback>
        </Avatar>
        <Avatar color="warning">
          <Avatar.Fallback>WR</Avatar.Fallback>
        </Avatar>
        <Avatar color="danger">
          <Avatar.Fallback>DG</Avatar.Fallback>
        </Avatar>
      </div>
    </div>
  );
}

export { AvatarColorsDemo };

Dependencies

More by Hero Ui

View all
  • DatePicker

    DatePicker

    465
  • Chip

    Chip

    440
  •  The Pagination

    The Pagination

    361
  • HeroUI Color Picker

    HeroUI Color Picker

    105
  • Skeleton

    Skeleton

    104
  • HeroUI Table

    HeroUI Table

    100
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    94
  • HeroUI AlertDialog

    HeroUI AlertDialog

    80