Command Palette

Search for a command to run...

Docs
Avatar with Badge

Avatar with Badge

An avatar component with a notification badge showing a count.

Installation

Usage

import AvatarBadge from "@/components/ruixen/avatar-badge";
 
export default function MyAvatar() {
  return (
    <AvatarBadge
      src="https://github.com/shadcn.png"
      alt="User"
      fallback="CN"
      count={6}
    />
  );
}

Props

PropTypeDefaultDescription
srcstring"https://github.com/shadcn.png"The image source URL
altstring"User"Alt text for the avatar image
fallbackstring"U"Fallback text when image fails
countnumber6The notification count to display
classNamestring-Additional CSS classes