bulb

An animated light-bulb icon from the hugeicons-animated registry that plays a short glow sequence on hover: the glass flexes, the filament dims and flickers, and five rays draw outward. It is built on motion/react and can also be triggered imperatively through a ref.

bulb
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/bulb

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

Usage

usage.tsx
import { BulbIcon } from '@/components/icons/bulb'; export default function Example() { return <BulbIcon className='text-amber-500' size={28} />; }
  • Showing an idea, insight, or 'light bulb moment' indicator in feature lists, onboarding steps, or tips panels
  • Adding a hover-triggered accent to a settings, tips, or suggestions button or card
  • Signaling a 'Pro tip' or lightbulb-themed toggle where the icon should react to user interaction
  • Triggering the glow sequence programmatically (for example, when a new suggestion arrives) through the ref handle

Examples

Hover tip button

A button-like wrapper whose icon animates on hover. The wrapper div receives the hover handlers, so hovering anywhere inside it plays the animation.

hover-tip-button.tsx
import { BulbIcon } from '@/components/icons/bulb'; export function TipButton() { return ( <button type='button' className='inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm'> <BulbIcon className='text-amber-500' size={20} aria-hidden='true' /> Show tip </button> ); }

Imperative trigger via ref

Uses the BulbIconHandle ref to play the animation on demand. Once the ref is attached, hover no longer triggers the animation; only startAnimation does.

imperative-trigger-via-ref.tsx
import { useRef } from 'react'; import { BulbIcon, type BulbIconHandle } from '@/components/icons/bulb'; export function NewIdeaBadge() { const ref = useRef<BulbIconHandle>(null); return ( <div onClick={() => ref.current?.startAnimation()} className='flex items-center gap-2'> <BulbIcon ref={ref} size={24} className='text-yellow-500' /> <span>New idea</span> </div> ); }

Large feature icon

Renders the icon at a larger size inside a feature card heading.

large-feature-icon.tsx
import { BulbIcon } from '@/components/icons/bulb'; export function FeatureHeading() { return ( <h3 className='flex items-center gap-3 text-lg font-semibold'> <BulbIcon size={40} className='text-amber-400' /> Smart suggestions </h3> ); }

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24.
classNamestring—Class name applied to the outer wrapper div (passed through cn). Use text color utilities to color the icon, since strokes use currentColor.
refReact.Ref<BulbIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation(). Attaching it switches the icon to controlled mode, so hover no longer starts the animation. stopAnimation only resets the icon when the internal loops option is true, which this icon sets to false, so it currently has no visible effect.
onMouseEnterReact.MouseEventHandler<HTMLDivElement>—Called on mouse enter of the wrapper div, before the animation starts.
onMouseLeaveReact.MouseEventHandler<HTMLDivElement>—Called on mouse leave of the wrapper div.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, role, tabIndex, data-*) are spread onto the wrapper div, not the svg.

Accessibility

  • The SVG has no role, title, or aria-label. If the icon conveys meaning, add aria-label to BulbIcon or a visible text label next to it; if it is decorative, pass aria-hidden='true'.
  • The wrapper is a plain div with no keyboard focus or key handlers. Animation is triggered only by mouse enter, so keyboard users get no hover feedback. Place the icon inside a focusable control, or trigger startAnimation from focus or key events via the ref.
  • Animation respects the user's prefers-reduced-motion setting: the hook returns early when useReducedMotion is true, so the icon stays static.
  • Color follows currentColor, so ensure the chosen text color has sufficient contrast against the background (WCAG 1.4.11 for non-text graphics).

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 "bulb" component (hugeicons-animated/bulb) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/bulb2. 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 { BulbIcon } from '@/components/icons/bulb'; export default function Example() { return <BulbIcon className='text-amber-500' size={28} />; }```

Files & dependencies

  • icons/bulb.tsx
  • lib/use-icon-animation.ts
dependenciesmotion

Looks similar, elsewhere