Avatar Profile
Composable identity rows with supporting text, badges, and actions.
Janaki Ammal
Botanist and cytogeneticist · India
View codeHide code
import { Button } from "@/components/ui/button";
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import {
AvatarProfile,
AvatarProfileAction,
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"
>
<Avatar size="xl">
<AvatarFallback alt="" name={"Janaki"} palette={BLUE_PALETTE} />
</Avatar>
<AvatarProfileContent>
<AvatarProfileName>{"Janaki Ammal"}</AvatarProfileName>
<AvatarProfileDescription>
Botanist and cytogeneticist · India
</AvatarProfileDescription>
</AvatarProfileContent>
<AvatarProfileAction>
<Button size="sm" variant="outline">
View
</Button>
</AvatarProfileAction>
</AvatarProfile>
);
}Installation
npx shadcn@latest add @blobz/avatar-profile button badgeThe shared Avatar component is installed automatically.
Usage
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import {
AvatarProfile,
AvatarProfileContent,
AvatarProfileDescription,
AvatarProfileName,
} from "@/components/blobz/avatar-profile";
<AvatarProfile variant="outline">
<Avatar>
<AvatarFallback alt="" name="Lirena" />
</Avatar>
<AvatarProfileContent>
<AvatarProfileName>Lirena</AvatarProfileName>
<AvatarProfileDescription>Design & development</AvatarProfileDescription>
</AvatarProfileContent>
</AvatarProfile>Use AvatarProfileAction for trailing controls. Its contents remain yours to wire to your application.
Badges
Compose a shadcn Badge beside the name to show a role or membership. The installation command above includes the Button and Badge components used in the previews.
Gagandeep Kang
MemberResearch & public health
View codeHide code
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge";
import {
AvatarProfile,
AvatarProfileContent,
AvatarProfileDescription,
AvatarProfileName,
} from "@/components/blobz/avatar-profile";
export function AvatarBadgeExample() {
return (
<AvatarProfile
className="w-full max-w-sm"
density="spacious"
variant="outline"
>
<Avatar>
<AvatarFallback
alt=""
name="Gagandeep"
palette={["#fff0e2", "#fa9769"]}
/>
</Avatar>
<AvatarProfileContent>
<div className="flex min-w-0 flex-wrap items-center gap-2">
<AvatarProfileName>Gagandeep Kang</AvatarProfileName>
<Badge variant="secondary">Member</Badge>
</div>
<AvatarProfileDescription>
Research & public health
</AvatarProfileDescription>
</AvatarProfileContent>
</AvatarProfile>
);
}For a standalone card with a biography and actions, see Profile Card.
API
AvatarProfile accepts div props, density (compact, default, spacious), and variant (default, muted, outline). The defaults are default for both.
AvatarProfileContent and AvatarProfileAction accept div props. AvatarProfileName and AvatarProfileDescription accept paragraph props. Place the shared Avatar directly inside the profile row.