question-mark-circle
An animated question-mark-in-circle icon for React built on motion/react. On hover it pulses the question mark's opacity and scale, and it can also be driven imperatively through a ref with startAnimation and stopAnimation.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @heroicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { QuestionMarkCircleIcon } from "@/components/ui/question-mark-circle";export default function Example() { return <QuestionMarkCircleIcon size={28} className="text-slate-700" />;}- Help, FAQ, or support buttons where a question-mark affordance should draw attention on hover
- Tooltip or onboarding triggers that need a subtle looping pulse to signal available help
- Inline help icons in forms or settings where a animated hint is preferred over a static glyph
- Interactive controls that need to start or stop the animation programmatically via a ref
Examples
Hover-triggered help icon
Default hover behavior: the question mark pulses while the pointer is over the icon.
import { QuestionMarkCircleIcon } from "@/components/ui/question-mark-circle";export default function HelpHint() { return ( <button type="button" aria-label="Help" className="inline-flex"> <QuestionMarkCircleIcon size={24} className="text-blue-600" /> </button> );}Programmatic control via ref
Uses the imperative handle to start the pulse when a panel opens and stop it when closed.
import { useRef } from "react";import { QuestionMarkCircleIcon, type QuestionMarkCircleIconHandle,} from "@/components/ui/question-mark-circle";export default function FaqToggle() { const iconRef = useRef<QuestionMarkCircleIconHandle>(null); return ( <div onMouseEnter={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} > <QuestionMarkCircleIcon ref={iconRef} size={32} /> </div> );}Icon inside a labeled support link
Pairs the animated icon with visible text for a clear, accessible help link.
import { QuestionMarkCircleIcon } from "@/components/ui/question-mark-circle";export default function SupportLink() { return ( <a href="/help" className="flex items-center gap-2 text-sm font-medium text-slate-800"> <QuestionMarkCircleIcon size={20} /> <span>Get help</span> </a> );}API reference
Accessibility
- The component renders a plain div and an SVG with no role or title; add aria-label or visible text to the parent control so screen readers announce its purpose.
- When the icon is decorative beside visible text, pass aria-hidden="true" through the spread props to hide it from assistive technology.
- The animation is a looping opacity and scale change; if the user prefers reduced motion, avoid triggering it via startAnimation or wrap usage with a media-query check.
- Because the hover animation depends on pointer events, keyboard users will not see it; pair it with focus-visible styles on the surrounding focusable element.
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.
Use the "question-mark-circle" component (heroicons-animated/question-mark-circle) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/question-mark-circle2. 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 { QuestionMarkCircleIcon } from "@/components/ui/question-mark-circle";export default function Example() { return <QuestionMarkCircleIcon size={28} className="text-slate-700" />;}```Files & dependencies
- question-mark-circle.tsx