Skip to content
Blobz docs

Avatar Profile

Compound primitives for identity rows with metadata and actions.

Janaki Ammal

Botanist and cytogeneticist · India

View code
avatar-profile-example.tsx
import { Button } from "@/components/ui/button";
import { DEMO_PEOPLE, getFirstName } from "@/lib/demo-people";

import {
	AvatarProfile,
	AvatarProfileAction,
	AvatarProfileAvatar,
	AvatarProfileContent,
	AvatarProfileDescription,
	AvatarProfileName,
} from "@/components/blobz/avatar-profile";

const BLUE_PALETTE = ["#dff4ff", "#38bdf8"] as const;

export function AvatarProfileExample() {
	return (
		<AvatarProfile
			className="w-full max-w-md"
			density="spacious"
			variant="outline"
		>
			<AvatarProfileAvatar
				alt=""
				name={getFirstName(DEMO_PEOPLE.janakiAmmal)}
				palette={BLUE_PALETTE}
				size="xl"
			/>
			<AvatarProfileContent>
				<AvatarProfileName>{DEMO_PEOPLE.janakiAmmal}</AvatarProfileName>
				<AvatarProfileDescription>
					Botanist and cytogeneticist · India
				</AvatarProfileDescription>
			</AvatarProfileContent>
			<AvatarProfileAction>
				<Button size="sm" variant="outline">
					View
				</Button>
			</AvatarProfileAction>
		</AvatarProfile>
	);
}

Installation

Register the Blobz registry once in your project, then install:

npx shadcn@latest add @blobz/avatar-profile

Usage

import {
  AvatarProfile,
  AvatarProfileAvatar,
  AvatarProfileContent,
  AvatarProfileDescription,
  AvatarProfileName,
} from "@/components/blobz/avatar-profile";

<AvatarProfile variant="outline">
  <AvatarProfileAvatar alt="" name={user.id} size="lg" />
  <AvatarProfileContent>
    <AvatarProfileName>{user.name}</AvatarProfileName>
    <AvatarProfileDescription>{user.email}</AvatarProfileDescription>
  </AvatarProfileContent>
</AvatarProfile>

API

Prop

Type

AvatarProfileAvatar accepts every BlobAvatar prop, including frame="circle" | "rounded" | "square".

Theme

On this page