magic-wand-01

An animated magic wand icon from the hugeicons-animated registry. The wand tilts and wiggles while its star shapes spin and pulse and small sparkles blink on, and the animation plays on hover.

magic-wand-01
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 @hugeicons-animated/magic-wand-01

Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { MagicWand01Icon } from '@/components/icons/magic-wand-01'; export default function Example() { return <MagicWand01Icon />; }
  • Use as a decorative or feature icon for AI, magic, enhancement, or auto-fix actions such as 'Improve with AI' or 'Magic fill'.
  • Use in buttons, menu items, or toolbars where a hover-triggered micro-animation adds delight without extra UI.
  • Use when you need an imperative trigger, via the ref handle, to start or stop the animation from parent logic such as loading states.
  • Avoid in dense data UIs where constant looping star motion would be distracting, or as the only indicator of state.

Examples

Default hover animation

Renders the icon at the default 28px size. The animation plays on mouse enter and resets on mouse leave.

default-hover-animation.tsx
import { MagicWand01Icon } from '@/components/icons/magic-wand-01'; export default function Basic() { return <MagicWand01Icon />; }

Custom size and color inside a button

Sets a 20px size and inherits the button's text color through currentColor. Standard div props such as aria-label pass through to the wrapper.

custom-size-and-color-inside-a-button.tsx
import { MagicWand01Icon } from '@/components/icons/magic-wand-01'; export default function MagicButton() { return <button type='button' className='inline-flex items-center gap-2 rounded-md bg-violet-600 px-4 py-2 text-white'><MagicWand01Icon size={20} aria-hidden='true' /><span>Enhance</span></button>; }

Programmatic control via ref

Attaching a ref switches the icon into controlled mode, so hover no longer auto-starts the animation. Call startAnimation and stopAnimation from your own logic, such as while a request is pending.

programmatic-control-via-ref.tsx
import { useRef, useEffect } from 'react'; import { MagicWand01Icon, type MagicWand01IconHandle } from '@/components/icons/magic-wand-01'; export default function Loading({ isLoading }: { isLoading: boolean }) { const iconRef = useRef<MagicWand01IconHandle>(null); useEffect(() => { if (isLoading) iconRef.current?.startAnimation(); else iconRef.current?.stopAnimation(); }, [isLoading]); return <MagicWand01Icon ref={iconRef} size={24} />; }

Hover callbacks

onMouseEnter and onMouseLeave are invoked before the internal animation handler, so you can add tracking or tooltip logic alongside the built-in behavior.

hover-callbacks.tsx
import { MagicWand01Icon } from '@/components/icons/magic-wand-01'; export default function Tracked() { return <MagicWand01Icon size={32} onMouseEnter={() => console.log('enter')} onMouseLeave={() => console.log('leave')} className='cursor-pointer text-amber-500' />; }

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the rendered SVG in pixels.
classNamestring—Class name applied to the wrapping div. Use it for layout and text color, since the stroke uses currentColor.
refReact.Ref<MagicWand01IconHandle>—Forwarded ref exposing startAnimation() and stopAnimation(). Attaching it disables automatic hover-triggered animation. stopAnimation resets the icon to its normal pose because loops is true.
onMouseEnterReact.MouseEventHandler<HTMLDivElement>—Called on mouse enter before the built-in animation starts.
onMouseLeaveReact.MouseEventHandler<HTMLDivElement>—Called on mouse leave before the built-in animation stops.
...HTMLAttributes<HTMLDivElement>React.HTMLAttributes<HTMLDivElement>—All other standard div attributes, such as id, aria-label, role, and style, are spread onto the wrapper div.

Accessibility

  • The icon is purely decorative by default and has no text alternative. When it conveys meaning, add aria-label or role='img' to the wrapper, or aria-hidden='true' when adjacent text already describes the action.
  • The animation respects the user's prefers-reduced-motion setting through motion's useReducedMotion. When reduced motion is on, startAnimation does nothing.
  • Hover-only animation gives no feedback to keyboard or touch users. Do not rely on it to communicate state. Pair it with a visible label or a state change.
  • Because the wrapper is a div, place it inside an interactive element such as a button rather than making the div itself focusable.

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 "magic-wand-01" component (hugeicons-animated/magic-wand-01) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/magic-wand-012. 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, ref, onMouseEnter, onMouseLeave, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { MagicWand01Icon } from '@/components/icons/magic-wand-01'; export default function Example() { return <MagicWand01Icon />; }```

Files & dependencies

  • icons/magic-wand-01.tsx
  • lib/use-icon-animation.ts
dependenciesmotion

Looks similar, elsewhere