User Plus

UserPlusIcon is an animated user-plus icon built with motion/react. On hover, or when started through a ref, a plus sign pops in and rotates into place beside the user silhouette.

User Plus
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add https://lucide-animated.com/r/user-plus.json

Usage

usage.tsx
import { UserPlusIcon } from "@/components/ui/user-plus"; export default function Example() { return <UserPlusIcon size={28} className="text-foreground" />; }
  • Inviting, adding, or onboarding a new user or member in a UI such as a team or contacts screen
  • Signaling a follow, add-friend, or new-contact action on a button or menu item
  • Adding playful micro-interaction feedback to an add-user call to action
  • Providing a hover-triggered icon that can also be driven programmatically through a ref for loading or success states

Examples

Basic hover animation

Renders the icon with default size 28. The plus animates on mouse enter and resets on mouse leave.

basic-hover-animation.tsx
import { UserPlusIcon } from "@/components/ui/user-plus";export default function BasicExample() {  return <UserPlusIcon />;}

Imperative control via ref

Uses the UserPlusIconHandle ref to start and stop the animation from code, for example after a successful invite.

imperative-control-via-ref.tsx
"use client";import { useRef } from "react";import { Button } from "@/components/ui/button";import { UserPlusIcon, type UserPlusIconHandle } from "@/components/ui/user-plus";export default function InviteButton() {  const iconRef = useRef<UserPlusIconHandle>(null);  return (    <Button      variant="outline"      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <UserPlusIcon ref={iconRef} size={20} />      Invite member    </Button>  );}

Larger icon with custom color

Sets a larger size and applies a Tailwind text color class, which flows into the stroke through currentColor.

larger-icon-with-custom-color.tsx
import { UserPlusIcon } from "@/components/ui/user-plus";export default function LargeIcon() {  return <UserPlusIcon size={40} className="text-blue-600" />;}

Custom mouse handlers in controlled mode

When a ref is attached, the component calls onMouseEnter and onMouseLeave instead of triggering its own animation, so custom logic can run alongside or in place of it.

custom-mouse-handlers-in-controlled-mode.tsx
"use client";import { useRef } from "react";import { UserPlusIcon, type UserPlusIconHandle } from "@/components/ui/user-plus";export default function ControlledHover() {  const iconRef = useRef<UserPlusIconHandle>(null);  return (    <UserPlusIcon      ref={iconRef}      aria-label="Add user"      role="img"      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    />  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the rendered SVG in pixels. The viewBox stays 0 0 24 24.
classNamestring—Additional CSS classes applied to the outer div wrapper through cn(). Use it to set color with text-* utilities or to set layout.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler. When a ref is attached, it is called instead of the built-in start animation, so the caller takes over animation control.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler. When a ref is attached, it is called instead of the built-in stop animation.
refReact.Ref<UserPlusIconHandle>—Forwarded ref exposing startAnimation() which plays the animation and stopAnimation() which returns the plus to its resting state.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes such as id, style, aria-label, role, and event handlers are spread onto the outer div wrapper.

Accessibility

  • The SVG has no title or aria-hidden attribute, so when the icon is meaningful add aria-label or role="img" on the component, which is spread onto the wrapper div.
  • If the icon is decorative next to visible text, wrap it or pass aria-hidden="true" so screen readers skip it.
  • The animation is hover-driven and purely visual. Do not rely on it alone to convey state; pair it with text or an accessible label.
  • Respect reduced-motion preferences by avoiding ref-triggered animations when the user has requested reduced motion, if your app supports that setting.
  • Keep interactive containers keyboard-focusable and provide a visible focus style, since hover-only triggers do not reach keyboard users.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "User Plus" component (lucide-animated/user-plus) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/user-plus.json2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, onMouseEnter, onMouseLeave, ref, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { UserPlusIcon } from "@/components/ui/user-plus"; export default function Example() { return <UserPlusIcon size={28} className="text-foreground" />; }```

Files & dependencies

  • user-plus.tsx
dependenciesmotion

Looks similar, elsewhere