User Round Cog

UserRoundCogIcon is an animated user-with-gear icon that rotates its cog 180 degrees with a spring motion on hover, or when a parent calls startAnimation/stopAnimation through a ref. It is built on motion/react and renders an inline SVG with currentColor strokes.

User Round Cog
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-round-cog.json

Usage

usage.tsx
import { UserRoundCogIcon } from '@/components/ui/user-round-cog';export function Example() {  return <UserRoundCogIcon />;}
  • Account, profile, or user-settings entries in navigation menus, sidebars, and dropdown triggers
  • Buttons or links that open user preferences, account management, or profile editing
  • Hover-revealed affordances where a subtle rotating gear signals configurable user settings
  • Dashboards that need a parent component to trigger the cog animation programmatically via a ref

Examples

Basic hover icon

Renders the icon with default size styling. Hovering the wrapper div plays the gear rotation.

basic-hover-icon.tsx
import { UserRoundCogIcon } from '@/components/ui/user-round-cog';export default function BasicExample() {  return (    <div className='flex items-center gap-2 text-sm'>      <UserRoundCogIcon />      <span>Account settings</span>    </div>  );}

Programmatic control via ref

Attaching a ref switches the component into controlled mode, so hover no longer animates it on its own. The parent calls startAnimation and stopAnimation instead.

programmatic-control-via-ref.tsx
import { useRef } from 'react';import { UserRoundCogIcon, type UserRoundCogIconHandle } from '@/components/ui/user-round-cog';export default function ControlledExample() {  const iconRef = useRef<UserRoundCogIconHandle>(null);  return (    <button      type='button'      className='inline-flex items-center gap-2 rounded-md border px-3 py-2'      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <UserRoundCogIcon ref={iconRef} />      Profile    </button>  );}

Menu item with larger rendered icon

The inner svg has a fixed 24x24 attribute size, so this example scales it through Tailwind arbitrary child selectors applied via className on the wrapper.

menu-item-with-larger-rendered-icon.tsx
import { UserRoundCogIcon } from '@/components/ui/user-round-cog';export default function MenuItemExample() {  return (    <a href='/settings/profile' className='flex items-center gap-3 rounded-md p-2 hover:bg-accent'>      <UserRoundCogIcon className='[&>svg]:h-8 [&>svg]:w-8 text-primary' />      <div>        <p className='font-medium'>Profile settings</p>        <p className='text-muted-foreground text-xs'>Edit name, avatar, and preferences</p>      </div>    </a>  );}

API reference

PropTypeDefaultDescription
sizenumber28Accepted and destructured from props with a default of 28, but the component does not apply it to the rendered svg, which keeps fixed width and height of 24. Use className with child selectors such as [&>svg]:h-8 [&>svg]:w-8 to resize the icon.
classNamestring—Class name applied to the wrapping div through the cn utility. Use it for layout, color, and sizing of the icon container.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler. When the component is controlled through a ref, this callback is called instead of the built-in animation trigger.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler. When the component is controlled through a ref, this callback is called instead of the built-in reset animation.
refReact.Ref<UserRoundCogIconHandle>—Forwarded ref exposing startAnimation() to rotate the gear to 180 degrees and stopAnimation() to return it to 0 degrees. Attaching the ref disables automatic hover animation.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes (id, aria-*, role, style, data-*, tabIndex, and so on) are spread onto the wrapping div.

Accessibility

  • The SVG has no title, desc, or aria-label, so it is decorative by default. When the icon is the only content of a control, add aria-label to the button or link, or pass aria-hidden='true' on the wrapper when a visible text label is present.
  • Hover-only animation gives no feedback to keyboard or touch users. Pair the icon with a visible label and do not rely on the animation to convey state.
  • Honor reduced-motion preferences by wrapping the trigger logic in a check for prefers-reduced-motion, or by not calling startAnimation when the user prefers reduced motion.
  • Because the icon uses currentColor, make sure the text color of its container meets WCAG contrast requirements against the background.

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 Round Cog" component (lucide-animated/user-round-cog) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/user-round-cog.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, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { UserRoundCogIcon } from '@/components/ui/user-round-cog';export function Example() {  return <UserRoundCogIcon />;}```

Files & dependencies

  • user-round-cog.tsx
dependenciesmotion

Looks similar, elsewhere