Gallery Vertical End

An animated SVG gallery icon from the lucide-animated registry that slides two top lines into place and fades them in on hover, while the rounded frame stays static. It is a client component built on motion/react and exposes an imperative start/stop handle through forwardRef.

Gallery Vertical End
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/gallery-vertical-end.json

Usage

usage.tsx
import { GalleryVerticalEndIcon } from "@/components/ui/gallery-vertical-end"; export default function Example() { return <GalleryVerticalEndIcon className="text-foreground" size={28} />; }
  • Use as an icon for gallery, image collection, or media library features where a vertically stacked gallery metaphor is needed.
  • Use inside buttons, navigation items, or cards that should show a subtle animated hover state on a line icon.
  • Use when you need imperative control of the animation, such as starting it on a row selection or when data loads, via the exposed ref handle.
  • Avoid when a static icon is enough or when the icon must convey meaning without motion for users who prefer reduced motion.

Examples

Hover-animated icon inside a button

The icon animates on mouse enter and resets on mouse leave, with no extra code needed.

hover-animated-icon-inside-a-button.tsx
import { GalleryVerticalEndIcon } from "@/components/ui/gallery-vertical-end"; import { Button } from "@/components/ui/button"; export default function GalleryButton() { return <Button variant="outline" size="sm"><GalleryVerticalEndIcon size={16} className="mr-2" />Gallery</Button>; }

Imperative control via ref

Start and stop the animation programmatically, for example when a collection finishes loading.

imperative-control-via-ref.tsx
import { useEffect, useRef } from "react"; import { GalleryVerticalEndIcon, type GalleryVerticalEndIconHandle } from "@/components/ui/gallery-vertical-end"; export default function LoadingGallery({ loaded }: { loaded: boolean }) { const iconRef = useRef<GalleryVerticalEndIconHandle>(null); useEffect(() => { if (loaded) { iconRef.current?.stopAnimation(); } else { iconRef.current?.startAnimation(); } }, [loaded]); return <GalleryVerticalEndIcon ref={iconRef} size={32} className="text-primary" />; }

Navigation item with custom handlers

Passing onMouseEnter or onMouseLeave switches the component into controlled mode, so the built-in animation is skipped and your handler runs instead, letting you trigger the animation via the ref.

navigation-item-with-custom-handlers.tsx
import { useRef } from "react"; import { GalleryVerticalEndIcon, type GalleryVerticalEndIconHandle } from "@/components/ui/gallery-vertical-end"; export default function NavItem() { const iconRef = useRef<GalleryVerticalEndIconHandle>(null); return <a href="/gallery" className="flex items-center gap-2" onMouseEnter={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()}><GalleryVerticalEndIcon ref={iconRef} size={20} />Gallery</a>; }

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24, so the icon scales proportionally.
classNamestring—Class names applied to the wrapping div (inherited from HTMLAttributes<HTMLDivElement>). Use it for color through text-* utilities, which the stroke inherits via currentColor, and for spacing.
onMouseEnter(event: React.MouseEvent<HTMLDivElement>) => void—Inherited from HTMLAttributes<HTMLDivElement>. Called on mouse enter. When provided, the component switches to controlled mode and skips its built-in start animation, so the consumer must call the ref handle to animate.
onMouseLeave(event: React.MouseEvent<HTMLDivElement>) => void—Inherited from HTMLAttributes<HTMLDivElement>. Called on mouse leave. When provided, the component switches to controlled mode and skips its built-in reset animation.
refReact.Ref<GalleryVerticalEndIconHandle>—Forwarded ref exposing startAnimation() (plays the animation) and stopAnimation() (returns the bars to their resting position). Typed by the exported GalleryVerticalEndIconHandle interface.

Accessibility

  • The icon is decorative and draws no text; when it conveys meaning on its own, add aria-label to the wrapping div or a visually hidden label next to it, and set aria-hidden="true" when a text label already exists.
  • The SVG has no title or role attribute; if it is used as a standalone image, add role="img" and an accessible name through the wrapper props.
  • The motion is a short translate and fade. For users with prefers-reduced-motion, avoid triggering startAnimation automatically, for example by checking the media query before calling it.
  • Color comes from currentColor, so keep sufficient contrast against the background (at least 3:1 for non-text graphics) when using the icon in buttons or links.

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 "Gallery Vertical End" component (lucide-animated/gallery-vertical-end) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/gallery-vertical-end.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.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { GalleryVerticalEndIcon } from "@/components/ui/gallery-vertical-end"; export default function Example() { return <GalleryVerticalEndIcon className="text-foreground" size={28} />; }```

Files & dependencies

  • gallery-vertical-end.tsx
dependenciesmotion

Looks similar, elsewhere