{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "avatar-group-shadcnui", "type": "registry:component", "title": "Avatar Group", "description": "Stacked avatar group with hover reveal and tooltips", "registryDependencies": [ "button" ], "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/avatars/avatar-group.tsx", "content": "\"use client\";\n\nimport { motion, useReducedMotion, type Transition } from \"framer-motion\";\nimport { User } from \"lucide-react\";\nimport { useId, useMemo } from \"react\";\n\ntype Avatar = {\n id: number;\n name: string;\n handle: string;\n color: string;\n};\n\nconst avatars: Avatar[] = [\n {\n id: 1,\n name: \"Avery Nolan\",\n handle: \"@averydesigns\",\n color: \"bg-[#4f46e5]\",\n },\n { id: 2, name: \"Lena Ortiz\", handle: \"@lena_motion\", color: \"bg-[#10b981]\" },\n { id: 3, name: \"Miles Chen\", handle: \"@mileslabs\", color: \"bg-[#38bdf8]\" },\n { id: 4, name: \"Nia Calder\", handle: \"@niacalder\", color: \"bg-[#f97316]\" },\n { id: 5, name: \"Theo Sato\", handle: \"@theosato\", color: \"bg-[#a855f7]\" },\n];\n\nexport function AvatarGroup() {\n const shouldReduceMotion = useReducedMotion();\n const groupId = useId();\n\n const animationConfig = useMemo(\n () =>\n shouldReduceMotion\n ? {\n initial: { opacity: 1, x: 0, scale: 1 },\n animate: { opacity: 1, x: 0, scale: 1 },\n whileHover: { scale: 1.08, zIndex: 10 },\n transition: { duration: 0 },\n }\n : {\n initial: (index: number) => ({\n opacity: 0,\n x: -12 * index,\n scale: 0.85,\n }),\n animate: { opacity: 1, x: 0, scale: 1 },\n whileHover: { scale: 1.18, zIndex: 10 },\n transition: (index: number) => ({\n delay: 0.08 * index,\n type: \"spring\",\n stiffness: 320,\n damping: 24,\n mass: 0.7,\n }),\n },\n [shouldReduceMotion]\n );\n\n return (\n \n \n \n\n \n \n {avatars.map((avatar, index) => (\n \n \n \n \n \n

{avatar.name}

\n \n {avatar.handle}\n \n \n \n ))}\n
\n \n +{avatars.length} collaborators\n \n \n \n );\n}\n", "type": "registry:component", "target": "components/uitripled/avatar-group-shadcnui.tsx" } ] }