Badge
A small count or dot pinned to the corner of an avatar.
Add it to your project
Or install the packages yourselfTerminal
npm install @heroui/react
First time with HeroUI? Set it up once.
The code
*/
import {Avatar, Badge} from "@heroui/react";
export default function BadgeDemo() {
return (
<div className="flex items-center gap-6">
<Badge.Anchor>
<Avatar>
<Avatar.Fallback>JD</Avatar.Fallback>
</Avatar>
<Badge color="danger" size="sm">
5This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
Changed for this site: A default export (HeroUI's docs use named ones); initials instead of profile photos.