{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shadcnblocks/avatar-group","title":"Avatar Group - Overlapping avatar group","description":"A horizontal row of overlapping circular avatars with spacing variants, hover spread, and an overflow count badge.","dependencies":["class-variance-authority","cn"],"registryDependencies":[],"files":[{"path":"components/shadcnblocks/avatar-group.tsx","content":"import { cva, type VariantProps } from \"class-variance-authority\";\nimport { Children, type ReactNode } from \"react\";\nimport { cn } from \"cn\";\n\nconst AvatarGroupVariants = cva(\"flex items-center\", {\n  variants: {\n    spacing: {\n      tight: \"-space-x-2\",\n      default: \"-space-x-1\",\n      loose: \"-space-x-0.5\",\n      none: \"space-x-0\",\n    },\n  },\n  defaultVariants: {\n    spacing: \"default\",\n  },\n});\n\nexport type AvatarGroupProps = {\n  children: ReactNode;\n  className?: string;\n  animate?: boolean;\n  size?: number;\n} & VariantProps<typeof AvatarGroupVariants>;\n\nexport type AvatarMoreProps = {\n  count: number;\n  className?: string;\n  size?: number;\n};\n\nexport const AvatarMore = ({\n  count,\n  className,\n  size = 40,\n  ...props\n}: AvatarMoreProps) => (\n  <div\n    data-slot=\"avatar\"\n    className={cn(\n      \"flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted text-xs font-medium text-muted-foreground\",\n      className,\n    )}\n    style={{\n      width: size,\n      height: size,\n    }}\n    {...props}\n  >\n    +{count}\n  </div>\n);\n\nexport const AvatarGroup = ({\n  children,\n  className,\n  animate = false,\n  spacing,\n  ...props\n}: AvatarGroupProps) => (\n  <div\n    className={cn(\n      \"h-14\",\n      AvatarGroupVariants({ spacing }),\n      animate && \"hover:space-x-0 [&>*]:transition-all\",\n      className,\n    )}\n    {...props}\n  >\n    {Children.map(children, (child) => {\n      if (!child) {\n        return null;\n      }\n\n      return child;\n    })}\n  </div>\n);\n","type":"registry:component"}],"type":"registry:component","meta":{"license":"https://www.shadcnblocks.com/license"}}