Corner Up Right

An animated corner-up-right arrow icon from lucide-animated, built on motion/react, that stretches horizontally and nudges right when hovered. It can also be driven imperatively through a ref with startAnimation and stopAnimation.

Corner Up Right
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-up-right.json

Usage

usage.tsx
import { CornerUpRightIcon } from "@/components/ui/corner-up-right";export default function Example() {  return <CornerUpRightIcon />;}
  • Showing a redirect, jump-to, or continue-to-next-step action in navigation or menus
  • Adding a subtle hover micro-interaction to links, list rows, or breadcrumb-style controls
  • Signaling a forward or redirect direction in a CTA or button label
  • Triggering the same animation programmatically, such as when a step or item becomes active, via the ref handle

Examples

Basic hover icon

Renders the icon at the default size of 28px; it animates automatically on mouse enter and leave.

basic-hover-icon.tsx
import { CornerUpRightIcon } from "@/components/ui/corner-up-right";export default function BasicExample() {  return <CornerUpRightIcon />;}

Inside a link with custom size and color

Sizes the icon to 20px and colors it through Tailwind text color, since the stroke uses currentColor.

inside-a-link-with-custom-size-and-color.tsx
import { CornerUpRightIcon } from "@/components/ui/corner-up-right";export default function LinkExample() {  return (    <a href="/next" className="inline-flex items-center gap-2 text-blue-600">      <CornerUpRightIcon size={20} className="cursor-pointer" />      Continue    </a>  );}

Programmatic control via ref

Uses a ref to call startAnimation and stopAnimation imperatively, for example when a row is focused. Once a ref is attached, the component's own mouse handlers are delegated to the optional onMouseEnter and onMouseLeave props.

programmatic-control-via-ref.tsx
import { useRef } from "react";import { CornerUpRightIcon, type CornerUpRightIconHandle } from "@/components/ui/corner-up-right";export default function RefExample() {  const iconRef = useRef<CornerUpRightIconHandle>(null);  return (    <div      onFocus={() => iconRef.current?.startAnimation()}      onBlur={() => iconRef.current?.stopAnimation()}      tabIndex={0}    >      <CornerUpRightIcon ref={iconRef} size={24} />    </div>  );}

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 for layout and color, for example text-* classes, since the stroke uses currentColor.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. When the ref handle is attached, this is called instead of the built-in start animation.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. When the ref handle is attached, this is called instead of the built-in stop animation.
refReact.Ref<CornerUpRightIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation() to control the animation imperatively. Attaching it switches off built-in hover animation.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes are spread onto the outer wrapper div, such as id, style, aria-*, and data-*.

Accessibility

  • The icon is a decorative SVG with no title, desc, or role, so screen readers may announce nothing or ignore it. If it conveys meaning, put an accessible name on the parent control with aria-label, or add visually hidden text.
  • When the icon sits inside an interactive element such as a link or button, mark the SVG as decorative in the wrapper with aria-hidden="true" if it is redundant with visible text. Pass aria-hidden through the spread props.
  • Hover-only animation gives no keyboard feedback. Pair it with focus handling via the ref (startAnimation on focus, stopAnimation on blur) so keyboard users see the same state.
  • The animation is short (0.45s) and small in amplitude, but respect users who prefer reduced motion by disabling the ref-driven animation calls when prefers-reduced-motion is set.

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

Files & dependencies

  • corner-up-right.tsx
dependenciesmotion

Looks similar, elsewhere