arrow-left-02
An animated left-arrow icon from the hugeicons-animated registry that plays a short squash-and-nudge motion when hovered. It is built with motion/react and can also be triggered imperatively through a ref.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { ArrowLeft02Icon } from '@/components/ui/arrow-left-02';export function BackLink() { return ( <a href="/" className="inline-flex items-center gap-2 text-foreground"> <ArrowLeft02Icon size={20} /> <span>Back</span> </a> );}- Back buttons, previous-page links, and breadcrumb or step navigation where a playful hover cue is wanted.
- Icon buttons in toolbars or headers that should feel responsive on hover.
- Imperative feedback, such as nudging the arrow on a keyboard shortcut or validation error, by calling startAnimation through a ref.
- Interfaces where a subtle micro-interaction adds polish without changing layout.
Examples
Back button with hover animation
Uses the default hover behavior inside a button. The icon inherits the button text color through currentColor.
import { ArrowLeft02Icon } from '@/components/ui/arrow-left-02';export function BackButton() { return ( <button type="button" className="inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm text-slate-700 hover:bg-slate-100"> <ArrowLeft02Icon size={18} /> Back </button> );}Imperatively triggered animation via ref
Passing a ref switches the icon to controlled mode, so hover no longer starts the animation. Call startAnimation from your own logic instead.
import { useRef } from 'react';import { ArrowLeft02Icon, type ArrowLeft02IconHandle } from '@/components/ui/arrow-left-02';export function PrevStep() { const iconRef = useRef<ArrowLeft02IconHandle>(null); return ( <button type="button" onClick={() => iconRef.current?.startAnimation()} className="inline-flex items-center gap-2 text-sm" > <ArrowLeft02Icon ref={iconRef} size={16} /> Previous step </button> );}Styled with className and mouse callbacks
className is applied to the wrapping div, and onMouseEnter and onMouseLeave are called before the built-in animation handlers run.
import { ArrowLeft02Icon } from '@/components/ui/arrow-left-02';export function NavIcon() { return ( <ArrowLeft02Icon size={24} className="text-indigo-600 cursor-pointer" onMouseEnter={() => console.log('enter')} onMouseLeave={() => console.log('leave')} /> );}API reference
Accessibility
- The icon is decorative. When it conveys meaning, place it inside a labeled control or add aria-label or aria-hidden="true" on the wrapper div as appropriate.
- Animation is skipped when the user prefers reduced motion, because useReducedMotion is checked before starting.
- Because the animation is hover-only by default, keyboard and touch users get no motion cue. Pair it with visible text or an accessible name on the parent control.
- The SVG uses currentColor, so it keeps sufficient contrast when the parent text color meets WCAG guidelines.
- Use startAnimation only for supplementary feedback. Do not rely on motion alone to communicate state.
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 "arrow-left-02" component (hugeicons-animated/arrow-left-02) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/arrow-left-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 { ArrowLeft02Icon } from '@/components/ui/arrow-left-02';export function BackLink() { return ( <a href="/" className="inline-flex items-center gap-2 text-foreground"> <ArrowLeft02Icon size={20} /> <span>Back</span> </a> );}```Files & dependencies
- icons/arrow-left-02.tsx
- lib/use-icon-animation.ts