Cloud Download

An animated cloud-download icon from lucide-animated built on motion/react. The download arrow shifts down on hover and returns, and it can also be driven programmatically through a ref.

Cloud Download
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/cloud-download.json

Usage

usage.tsx
import { CloudDownloadIcon } from '@/components/ui/cloud-download';export default function Example() {  return <CloudDownloadIcon size={28} className='text-foreground' />;}
  • Download or save-to-cloud actions in toolbars, file managers, and export buttons where a micro-interaction adds feedback
  • Sync or backup indicators that should animate on hover to suggest data transfer
  • Landing pages or dashboards that need a lightweight, Lucide-style animated icon with no extra styling setup
  • Cases where an animation must be triggered by application state through a ref, such as starting the arrow motion while a download is in progress

Examples

Basic hover icon

Renders the icon with default size 28. The arrow animates on mouse enter and returns on mouse leave.

basic-hover-icon.tsx
import { CloudDownloadIcon } from '@/components/ui/cloud-download';export default function BasicExample() {  return <CloudDownloadIcon />;}

Icon inside a download button

Uses a smaller size and inherits color from the button text, so it matches the label.

icon-inside-a-download-button.tsx
import { CloudDownloadIcon } from '@/components/ui/cloud-download';export default function DownloadButton() {  return (    <button className='inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-primary-foreground'>      <CloudDownloadIcon size={18} />      Download    </button>  );}

Controlled animation via ref

Attaches a ref to play the animation programmatically. When a ref is attached, the built-in hover handlers defer to your onMouseEnter and onMouseLeave callbacks instead of starting the animation themselves.

controlled-animation-via-ref.tsx
import { useRef } from 'react';import { CloudDownloadIcon, type CloudDownloadIconHandle } from '@/components/ui/cloud-download';export default function SyncStatus() {  const iconRef = useRef<CloudDownloadIconHandle>(null);  return (    <div      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <CloudDownloadIcon ref={iconRef} size={32} />    </div>  );}

Looping animation while downloading

Starts the arrow motion when a download begins and stops it when the download finishes, driven by application state.

looping-animation-while-downloading.tsx
import { useEffect, useRef } from 'react';import { CloudDownloadIcon, type CloudDownloadIconHandle } from '@/components/ui/cloud-download';export default function DownloadProgress({ isDownloading }: { isDownloading: boolean }) {  const iconRef = useRef<CloudDownloadIconHandle>(null);  useEffect(() => {    if (isDownloading) iconRef.current?.startAnimation();    else iconRef.current?.stopAnimation();  }, [isDownloading]);  return <CloudDownloadIcon ref={iconRef} size={24} className='text-blue-500' />;}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24, so the icon scales proportionally.
classNamestring—Applied to the wrapping div, not the svg. Use it for color (text-*), spacing, or layout classes. Inherited from HTMLAttributes<HTMLDivElement>.
onMouseEnter(event: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. When a ref is attached, this callback runs and the built-in animation start is skipped, so you must call startAnimation yourself.
onMouseLeave(event: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. When a ref is attached, this callback runs and the built-in animation reset is skipped, so you must call stopAnimation yourself.
refReact.Ref<CloudDownloadIconHandle>—Exposes startAnimation() (plays the arrow offset motion, to the 'initial' variant) and stopAnimation() (returns the arrow to the 'active' variant). Setting a ref switches the component to controlled mode.
...propsHTMLAttributes<HTMLDivElement>—Any other standard div attributes (id, style, aria-*, data-*, etc.) are spread onto the wrapping div.

Accessibility

  • The SVG has no title, desc, or role, so screen readers may announce nothing useful. Add role='img' and aria-label (for example aria-label='Download') on the wrapper, or pass aria-hidden='true' when the icon is decorative next to visible text.
  • When the icon conveys meaning alone, such as in an icon-only button, put the accessible name on the button itself with aria-label, since the icon does not provide one.
  • The hover animation is purely decorative and conveys no information, so do not rely on it to communicate state. Pair state changes with text or an aria-live update.
  • Motion uses a springy overshoot over 0.3s. Respect prefers-reduced-motion by skipping startAnimation calls or disabling the motion in your app when that media query matches.
  • Because the icon is hover-driven, keyboard users do not trigger the animation. Call startAnimation on focus if the animation carries meaning.

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 "Cloud Download" component (lucide-animated/cloud-download) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/cloud-download.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 { CloudDownloadIcon } from '@/components/ui/cloud-download';export default function Example() {  return <CloudDownloadIcon size={28} className='text-foreground' />;}```

Files & dependencies

  • cloud-download.tsx
dependenciesmotion

Looks similar, elsewhere