Folder Up

An animated folder-up icon from the lucide-animated registry that shows an upward arrow inside a folder outline and nudges the arrow upward on hover. It is a forwardRef component that also exposes startAnimation and stopAnimation through a ref handle.

Folder 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/folder-up.json

Usage

usage.tsx
import { FolderUpIcon } from "@/components/ui/folder-up";<FolderUpIcon />
  • Use for navigation or actions that move a file or item up a directory level, such as a parent-folder or 'go up' button.
  • Use in file browsers, upload dialogs, or breadcrumb toolbars where a subtle hover cue signals an upward action.
  • Use when you need an animated icon that can be triggered programmatically via a ref, for example to play the animation after a successful action.
  • Avoid when a static icon is sufficient or when the upward-arrow meaning is ambiguous in context.

Examples

Hover animation on a button

Default hover behavior: the arrow animates when the pointer enters the icon wrapper. Color is controlled via Tailwind text classes because the stroke uses currentColor.

hover-animation-on-a-button.tsx
import { FolderUpIcon } from "@/components/ui/folder-up";export default function ParentFolderButton() {  return (    <button type="button" className="inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm hover:bg-accent">      <FolderUpIcon className="text-muted-foreground" />      Parent folder    </button>  );}

Programmatic control via ref

Passing a ref switches the component to controlled mode: hover no longer triggers the animation automatically, and you call startAnimation and stopAnimation yourself. Mouse callbacks you pass are still invoked.

programmatic-control-via-ref.tsx
import { useRef } from "react";import { FolderUpIcon, type FolderUpIconHandle } from "@/components/ui/folder-up";export default function UploadStatus() {  const iconRef = useRef<FolderUpIconHandle>(null);  return (    <div      onClick={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <FolderUpIcon ref={iconRef} size={32} />    </div>  );}

Custom size and color in a breadcrumb

The size prop sets both width and height of the SVG in pixels. The default is 28. Use className to set color and spacing on the wrapper div.

custom-size-and-color-in-a-breadcrumb.tsx
import { FolderUpIcon } from "@/components/ui/folder-up";export default function Breadcrumb() {  return (    <nav className="flex items-center gap-1 text-sm">      <FolderUpIcon size={20} className="text-blue-600 dark:text-blue-400" />      <span>Documents / Projects</span>    </nav>  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. Applied to both the svg width and height attributes.
classNamestring—Class names applied to the wrapper div. Use it to set color (via currentColor), spacing, or layout.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on pointer enter. In uncontrolled mode it runs after the built-in animation starts. In controlled mode (ref attached) it replaces the built-in animation trigger and is the only handler invoked.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on pointer leave. In uncontrolled mode the arrow returns to rest. In controlled mode it replaces the built-in reset and is the only handler invoked.
refReact.Ref<FolderUpIconHandle>—Exposes FolderUpIconHandle with startAnimation() and stopAnimation(). Attaching a ref enables controlled mode, which disables automatic hover animation.
...propsHTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, data-*, onClick, etc.) are spread onto the wrapper div.

Accessibility

  • The component renders a plain div with an inline svg and no role, aria-label, or title, so screen readers may announce nothing or unrelated graphics. Add aria-label or wrap it in a labeled button for meaningful output.
  • When the icon is decorative beside visible text, pass aria-hidden="true" through props to hide it from assistive technology.
  • The hover animation is purely visual and conveys no state. Do not rely on it alone to communicate that an action is available; pair it with a visible label or tooltip.
  • Respect reduced-motion preferences by wrapping the trigger logic in a check for prefers-reduced-motion, or by using controlled mode and skipping startAnimation when the user prefers reduced motion.
  • When used as a button icon, ensure the containing element is focusable and keyboard-operable, since the hover animation is not triggered by keyboard focus by default.

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 "Folder Up" component (lucide-animated/folder-up) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/folder-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 { FolderUpIcon } from "@/components/ui/folder-up";<FolderUpIcon />```

Files & dependencies

  • folder-up.tsx
dependenciesmotion

Looks similar, elsewhere