Corner Right Up

An animated corner-right-up arrow icon built on motion/react that stretches vertically and bounces upward on hover or via an imperative handle. It is a drop-in replacement for the static Lucide corner-right-up icon with an SVG-based animation.

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

Usage

usage.tsx
import { CornerRightUpIcon } from "@/components/ui/corner-right-up";export function Example() {  return <CornerRightUpIcon className="text-foreground" size={28} />;}
  • Use as a hover-animated navigation or redirect indicator in buttons, links, or menu items.
  • Use when a static arrow icon should give playful micro-feedback on interaction.
  • Use inside controlled UIs where the parent triggers the bounce via a ref (for example, on form submit or when a step completes).
  • Avoid in dense data tables or where motion should be suppressed for reduced-motion users unless you handle that yourself.

Examples

Hover-animated link

Hovering the wrapper div plays the bounce animation automatically.

hover-animated-link.tsx
import { CornerRightUpIcon } from "@/components/ui/corner-right-up";export function GoToDocsLink() {  return (    <a href="/docs" className="inline-flex items-center gap-2 text-sm font-medium">      Go to docs      <CornerRightUpIcon size={18} />    </a>  );}

Controlled animation via ref

Call startAnimation and stopAnimation from a parent through the forwarded ref.

controlled-animation-via-ref.tsx
"use client";import { useRef } from "react";import { Button } from "@/components/ui/button";import {  CornerRightUpIcon,  type CornerRightUpIconHandle,} from "@/components/ui/corner-right-up";export function ContinueButton() {  const iconRef = useRef<CornerRightUpIconHandle>(null);  return (    <Button      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      Continue      <CornerRightUpIcon ref={iconRef} size={16} />    </Button>  );}

Custom styling with className

The className is applied to the wrapping div, so Tailwind utilities control color and spacing.

custom-styling-with-classname.tsx
import { CornerRightUpIcon } from "@/components/ui/corner-right-up";export function NextStepIcon() {  return <CornerRightUpIcon className="text-blue-600 dark:text-blue-400 p-1" size={32} />;}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels.
classNamestring—Class names applied to the wrapping div (merged with cn).
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler. Called by the component; the default bounce runs only when the component is not controlled via ref.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler. Called by the component; the reset animation runs only when the component is not controlled via ref.
refReact.Ref<CornerRightUpIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation() methods. Using it switches the component into controlled mode, disabling automatic hover animation.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes are spread onto the wrapping div.

Accessibility

  • The SVG has no title or aria-label; if the icon conveys meaning on its own, wrap it or pass aria-label and role="img" via props on the wrapping div.
  • When the icon sits beside text, keep it decorative with aria-hidden="true" to avoid redundant announcements.
  • The animation is a short bounce, but consider checking prefers-reduced-motion and avoiding startAnimation calls for users who opt out.
  • Because the wrapper is a div with mouse handlers only, it is not focusable; supply keyboard triggering via the ref API when the icon is part of an interactive control.
  • Color follows currentColor, so ensure the surrounding text has sufficient contrast against its 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 "Corner Right Up" component (lucide-animated/corner-right-up) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/corner-right-up.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 { CornerRightUpIcon } from "@/components/ui/corner-right-up";export function Example() {  return <CornerRightUpIcon className="text-foreground" size={28} />;}```

Files & dependencies

  • corner-right-up.tsx
dependenciesmotion

Looks similar, elsewhere