arrow-right-02

An animated right-arrow icon from the hugeicons-animated registry. On hover it plays a short one-shot motion where the arrow shifts right with a slight squash and rebound, and it can also be triggered programmatically through a ref.

arrow-right-02
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/arrow-right-02

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

Usage

usage.tsx
import { ArrowRight02Icon } from '@/components/icons/arrow-right-02';<ArrowRight02Icon className='text-foreground' />
  • Call-to-action links or buttons that lead forward, such as 'Next', 'Continue', or 'Learn more'.
  • Navigation affordances in menus, breadcrumbs, or list rows where a hover micro-interaction adds feedback.
  • Inline directional cues that should animate on hover but stay static for users who prefer reduced motion.
  • Cases where a parent component needs to trigger the arrow animation imperatively, for example when a card is hovered or focused.

Examples

Hover-animated CTA link

A link that uses the arrow as a trailing hover cue. The arrow inherits text color through currentColor.

hover-animated-cta-link.tsx
import Link from 'next/link';import { ArrowRight02Icon } from '@/components/icons/arrow-right-02';export function LearnMoreLink() {  return (    <Link href='/docs' className='inline-flex items-center gap-2 text-sm font-medium text-blue-600'>      Learn more      <ArrowRight02Icon size={16} className='text-blue-600' />    </Link>  );}

Imperative trigger via ref

Using the exported handle type, a parent can start the animation programmatically. When a ref is attached, mouse hover no longer triggers the animation automatically.

imperative-trigger-via-ref.tsx
import { useRef } from 'react';import { ArrowRight02Icon, type ArrowRight02IconHandle } from '@/components/icons/arrow-right-02';export function NextStepCard() {  const iconRef = useRef<ArrowRight02IconHandle>(null);  return (    <div      className='rounded-lg border p-4'      onFocus={() => iconRef.current?.startAnimation()}    >      <button className='flex items-center gap-2'>        Next step        <ArrowRight02Icon ref={iconRef} size={20} />      </button>    </div>  );}

Pass-through mouse handlers and size

The component accepts onMouseEnter and onMouseLeave, which are called before the built-in animation handlers run. Other div attributes are forwarded to the wrapper element.

pass-through-mouse-handlers-and-size.tsx
import { ArrowRight02Icon } from '@/components/icons/arrow-right-02';export function ArrowButton() {  return (    <button      type='button'      className='inline-flex h-10 items-center rounded-md bg-zinc-900 px-4 text-white'    >      <ArrowRight02Icon        size={18}        className='text-white'        onMouseEnter={() => console.log('hovered')}        aria-hidden='true'      />    </button>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 24x24, so the icon scales proportionally.
classNamestring—Class names applied to the outer div wrapper. Use text color utilities to change the stroke color, since strokes use currentColor.
onMouseEnterMouseEventHandler<HTMLDivElement>—Optional callback invoked on mouse enter before the icon's own start-animation logic runs. Ignored for animation control when a ref is attached, because hover then does not auto-trigger.
onMouseLeaveMouseEventHandler<HTMLDivElement>—Optional callback invoked on mouse leave before the icon's own stop logic runs. Stopping only has an effect when the internal loops option is enabled, which it is not for this icon.
refRef<ArrowRight02IconHandle>—Forwarded ref exposing startAnimation() and stopAnimation(). Calling startAnimation plays the animation once unless reduced motion is enabled or it is already playing. Calling stopAnimation does nothing for this non-looping icon.
HTMLAttributes<HTMLDivElement>extends—All other standard div attributes (id, style, aria-*, data-*, tabIndex, event handlers) are spread onto the wrapper div.

Accessibility

  • The SVG has no role, title, or aria-label, so it is treated as decorative by default. If the icon conveys meaning on its own, add role='img' and an aria-label to the wrapper, or place it next to visible text.
  • If the icon sits beside a text label, pass aria-hidden='true' so screen readers do not announce an unlabeled graphic.
  • Animation respects the user's prefers-reduced-motion setting via useReducedMotion; with reduced motion on, hover and startAnimation do nothing and the icon stays static.
  • Because the animation is a visual hover cue, do not rely on it alone to communicate interactivity. Keep focus-visible styles on the interactive parent element.
  • Hover-only triggering is not available to keyboard users, so when the icon is inside a focusable control, use the ref handle from onFocus or similar handlers to provide equivalent feedback.

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 "arrow-right-02" component (hugeicons-animated/arrow-right-02) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/arrow-right-022. 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 { ArrowRight02Icon } from '@/components/icons/arrow-right-02';<ArrowRight02Icon className='text-foreground' />```

Files & dependencies

  • icons/arrow-right-02.tsx
  • lib/use-icon-animation.ts
dependenciesmotion

Looks similar, elsewhere