Arrow Down

An animated down-arrow icon built on motion/react that bounces its arrow head downward and briefly shortens the vertical stem on hover or when triggered imperatively. It is a drop-in replacement for a static arrow-down SVG icon with a forwardRef handle for programmatic control.

Arrow Down
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 https://lucide-animated.com/r/arrow-down.json

Usage

usage.tsx
import { ArrowDownIcon } from "@/components/ui/arrow-down";export default function Example() {  return <ArrowDownIcon />;}
  • Download, scroll-down, or 'more below' affordances where a subtle motion hints at direction
  • Buttons or list rows that need a hover-triggered arrow micro-interaction
  • Imperative feedback such as pulsing the arrow while a 'load more' or 'next' action is pending, via the ref handle
  • Replacing a static lucide-style arrow-down icon in an existing icon set with an animated variant

Examples

Hover-triggered arrow in a button

The arrow animates automatically when the pointer enters the wrapper div, with no ref needed.

hover-triggered-arrow-in-a-button.tsx
import { ArrowDownIcon } from "@/components/ui/arrow-down";export default function DownloadButton() {  return (    <button className="inline-flex items-center gap-2 rounded-md border px-4 py-2 text-sm">      <ArrowDownIcon size={18} className="text-blue-600" />      Download    </button>  );}

Imperative control via ref

Start and stop the animation programmatically, for example while a request is pending.

imperative-control-via-ref.tsx
import { useRef, useEffect } from "react";import { ArrowDownIcon, type ArrowDownIconHandle } from "@/components/ui/arrow-down";export default function LoadMore({ loading }: { loading: boolean }) {  const iconRef = useRef<ArrowDownIconHandle>(null);  useEffect(() => {    if (loading) iconRef.current?.startAnimation();    else iconRef.current?.stopAnimation();  }, [loading]);  return (    <button className="flex items-center gap-1">      <ArrowDownIcon ref={iconRef} size={20} />      Load more    </button>  );}

Scroll-hint link

A small hint linking to content below, with a larger icon size.

scroll-hint-link.tsx
import { ArrowDownIcon } from "@/components/ui/arrow-down";export default function ScrollHint() {  return (    <a href="#details" className="flex flex-col items-center text-muted-foreground" aria-label="Scroll to details">      <ArrowDownIcon size={32} />    </a>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels.
classNamestring—Class names applied to the outer wrapper div (passed through cn). Use text-* utilities to change the stroke color since it uses currentColor.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. When the ref handle is attached, the internal hover animation is disabled and this handler is invoked instead.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. When the ref handle is attached, the internal hover animation is disabled and this handler is invoked instead.
refReact.Ref<ArrowDownIconHandle>—Exposes startAnimation() and stopAnimation() to control the animation imperatively. Attaching the ref switches off automatic hover animation.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes are spread onto the wrapper div.

Accessibility

  • The component renders no text or role; it is decorative by default. Add aria-hidden="true" when the arrow accompanies visible text.
  • When the icon is the sole content of a control, provide an accessible name on the parent button or link via aria-label or visually hidden text.
  • Animation is triggered by hover and imperative calls only; it does not autoplay on mount. Consider respecting prefers-reduced-motion by not calling startAnimation when the user prefers reduced motion.
  • Because the wrapper is a div with mouse handlers, it is not focusable; keyboard users receive no hover equivalent, so pair with a focusable parent for interactive use.

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 Down" component (lucide-animated/arrow-down) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/arrow-down.json2. 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, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ArrowDownIcon } from "@/components/ui/arrow-down";export default function Example() {  return <ArrowDownIcon />;}```

Files & dependencies

  • arrow-down.tsx
dependenciesmotion

Looks similar, elsewhere