kanchanasw

Avatar

Component

About

A profile picture component with a hand-drawn sketch frame that falls back to initials and can show an online/offline/busy status dot.

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

"use client";

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

// Synthetic placeholder graphic (abstract gradient tile), not a real photo or
// third-party asset — stands in for a user-provided profile image.
const syntheticPhoto =
  "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='96'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0%' stop-color='%23fca5a5'/><stop offset='100%' stop-color='%23f87171'/></linearGradient></defs><rect width='96' height='96' fill='url(%23g)'/></svg>";

export default function AvatarDemo() {
  return (
    <div className="flex min-h-screen w-full items-center justify-center bg-background p-10">
      <div className="flex flex-wrap items-center gap-6">
        <Avatar fallback="AL" alt="Ada Lovelace" status="online" />
        <Avatar fallback="JM" alt="Jamie Moss" status="busy" shape="square" />
        <Avatar
          src={syntheticPhoto}
          alt="Studio avatar"
          fallback="SA"
          size="lg"
        />
      </div>
    </div>
  );
}

Dependencies

More by kanchanasw

View all
  • Sketch Tabs

    Sketch Tabs

    145
  • Hand-Drawn Checkbox

    Hand-Drawn Checkbox

    78
  • Sketch Textarea

    Sketch Textarea

    68
  • Sketch Hover Card

    Sketch Hover Card

    53
  • Sketch Button

    Sketch Button

    29
  • Pagination

    Pagination

    12
  • Radial Menu

    Radial Menu

    7
  • Radial Progress

    Radial Progress

    4