arrow-long-left

An animated left-pointing long arrow icon for React that stretches its shaft and nudges its arrowhead leftward on hover or when triggered imperatively. It is built on motion/react and exposes a ref handle for programmatic start and stop of the animation.

arrow-long-left
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 @heroicons-animated/arrow-long-left

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

Usage

usage.tsx
import { ArrowLongLeftIcon } from "@/components/ui/arrow-long-left";export function Example() {  return <ArrowLongLeftIcon />;}
  • Back buttons or 'previous' navigation links where a long directional arrow signals returning or going left
  • Hover-reactive CTA or breadcrumb controls that need a small motion cue without a heavy animation
  • Imperative feedback, such as animating the arrow when a form step or pagination action is triggered via a ref
  • Icon-only controls in toolbars or headers where a crisp, currentColor-tinted outline icon is preferred

Examples

Hover-animated back link

A navigation link whose arrow animates on hover using the built-in mouse handlers.

hover-animated-back-link.tsx
import { ArrowLongLeftIcon } from "@/components/ui/arrow-long-left";export function BackLink() {  return (    <a href="/products" className="inline-flex items-center gap-2 text-sm text-neutral-700">      <ArrowLongLeftIcon size={20} />      Back to products    </a>  );}

Imperative control via ref

Start and stop the animation programmatically using the exported handle type.

imperative-control-via-ref.tsx
import { useRef } from "react";import { ArrowLongLeftIcon, type ArrowLongLeftIconHandle } from "@/components/ui/arrow-long-left";export function PrevButton({ onClick }: { onClick: () => void }) {  const iconRef = useRef<ArrowLongLeftIconHandle>(null);  return (    <button      type="button"      onClick={onClick}      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}      className="inline-flex items-center gap-2 rounded-md border px-3 py-2"    >      <ArrowLongLeftIcon ref={iconRef} size={18} />      Previous    </button>  );}

Custom color and size

Colors come from currentColor, so Tailwind text utilities control the stroke; size sets width and height.

custom-color-and-size.tsx
import { ArrowLongLeftIcon } from "@/components/ui/arrow-long-left";export function ColoredArrow() {  return <ArrowLongLeftIcon size={32} className="text-blue-600" aria-label="Go back" role="img" />;}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels.
classNamestring—Class names applied to the outer wrapper div, merged with cn().
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler on the wrapper div. When a ref handle is attached, the animation is no longer triggered automatically and this handler is called instead.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler on the wrapper div. When a ref handle is attached, the animation is no longer triggered automatically and this handler is called instead.
refReact.Ref<ArrowLongLeftIconHandle>—Exposes startAnimation() and stopAnimation() for imperative control of the animation.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes are spread onto the wrapper div, such as id, style, aria-label, and role.

Accessibility

  • The component renders a decorative SVG without a title or aria-label; when the icon conveys meaning on its own, pass aria-label and role="img" on the wrapper, or place visible text beside it.
  • When the icon sits inside a button or link that already has visible text, mark it decorative (for example aria-hidden="true") to avoid duplicate announcements.
  • The animation is a short 0.4 second transform and path change; it does not flash, so it poses no seizure risk, but respect prefers-reduced-motion by avoiding triggering startAnimation when the user prefers reduced motion.
  • Because the stroke uses currentColor, ensure the surrounding text color meets WCAG contrast requirements against the background.

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-long-left" component (heroicons-animated/arrow-long-left) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/arrow-long-left2. 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 { ArrowLongLeftIcon } from "@/components/ui/arrow-long-left";export function Example() {  return <ArrowLongLeftIcon />;}```

Files & dependencies

  • arrow-long-left.tsx
dependenciesmotion

Looks similar, elsewhere