Avatar
A round badge for a person, here with their initials in five colours.
A round badge for a person, here with their initials in five colours.
npm install @heroui/react
First time with HeroUI? Set it up once.
/**
* Demo from HeroUI, https://heroui.com (docs example avatar/colors.tsx).
* Apache-2.0, Copyright 2025 NextUI Inc. Full text: https://github.com/heroui-inc/heroui/blob/main/LICENSE
* Changed for Tastebud: a default export (HeroUI's docs use named ones).
*/
import {Avatar} from "@heroui/react";
export default function AvatarDemo() {
return (
<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>
);
}
Changed for this site: A default export (HeroUI's docs use named ones).