Corner Right Down

An animated corner-right-down arrow icon built on motion/react that stretches vertically and nudges downward on hover, with an imperative ref API for programmatic control. It renders an inline SVG at a configurable size and uses currentColor for its stroke.

Corner Right 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/corner-right-down.json

Usage

usage.tsx
import { CornerRightDownIcon } from "@/components/ui/corner-right-down";export default function Example() {  return <CornerRightDownIcon />;}
  • Indicating a move, continuation, or downward-right navigation step in menus, breadcrumbs, or flow diagrams
  • Adding a subtle hover micro-interaction to buttons, list items, or links that lead to a next or nested item
  • Decorating call-to-action or 'go down/next' controls where the icon should react to user intent
  • Driving the animation programmatically (for example, when a step becomes active) through the forwarded ref

Examples

Hover-triggered icon inside a button

The default hover behavior plays the stretch animation when the pointer enters the wrapper div.

hover-triggered-icon-inside-a-button.tsx
import { CornerRightDownIcon } from "@/components/ui/corner-right-down";export default function NextButton() {  return (    <button className="inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm">      Continue      <CornerRightDownIcon size={18} className="text-zinc-700" />    </button>  );}

Programmatic control via ref

Using the forwarded ref switches the component to controlled mode, so hover no longer triggers the animation and startAnimation/stopAnimation drive it instead.

programmatic-control-via-ref.tsx
"use client";import { useRef } from "react";import { CornerRightDownIcon, type CornerRightDownIconHandle } from "@/components/ui/corner-right-down";export default function ControlledIcon() {  const iconRef = useRef<CornerRightDownIconHandle>(null);  return (    <div      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <CornerRightDownIcon ref={iconRef} size={32} />    </div>  );}

Animating a list item when it becomes active

Starts the animation once a step is selected, without relying on hover.

animating-a-list-item-when-it-becomes-active.tsx
"use client";import { useEffect, useRef } from "react";import { CornerRightDownIcon, type CornerRightDownIconHandle } from "@/components/ui/corner-right-down";export default function ActiveStep({ active }: { active: boolean }) {  const iconRef = useRef<CornerRightDownIconHandle>(null);  useEffect(() => {    if (active) iconRef.current?.startAnimation();    else iconRef.current?.stopAnimation();  }, [active]);  return <CornerRightDownIcon ref={iconRef} size={24} />;}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. Applied to both the width and height attributes.
classNamestring—Class name applied to the outer wrapper div (passed through cn). Use it to set color via currentColor or margins.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on pointer enter. In uncontrolled mode it is invoked after the animation starts; in controlled mode (ref attached) it replaces the built-in animation trigger and is the only handler called.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on pointer leave. In uncontrolled mode the icon returns to its normal state; in controlled mode it is the only handler called.
refReact.Ref<CornerRightDownIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation(). Attaching a ref switches the component into controlled mode, disabling hover-driven animation.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes (id, aria-*, role, style, onClick, etc.) are spread onto the outer wrapper div.

Accessibility

  • The rendered SVG has no title, desc, or aria-label; if the icon conveys meaning on its own, pass aria-label or role="img" via props on the wrapper div.
  • If the icon is decorative beside visible text, add aria-hidden="true" to the component so screen readers skip it.
  • The animation is purely visual and does not convey state; do not rely on the motion alone to communicate information.
  • Respect reduced-motion preferences by gating startAnimation calls or hover handling with a prefers-reduced-motion check in the consuming app, since the component does not check it internally.
  • Inside an interactive element such as a button, the icon inherits the element's accessible name, so ensure the button has text or an aria-label.

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 "Corner Right Down" component (lucide-animated/corner-right-down) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/corner-right-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 { CornerRightDownIcon } from "@/components/ui/corner-right-down";export default function Example() {  return <CornerRightDownIcon />;}```

Files & dependencies

  • corner-right-down.tsx
dependenciesmotion

Looks similar, elsewhere