archive-box-arrow-down
An animated outline archive-box icon with a down arrow that dips into the tray on hover. It is built with Motion and exposes an imperative ref so parents can start and stop the animation.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @heroicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { ArchiveBoxArrowDownIcon } from "@/components/ui/archive-box-arrow-down";export default function Demo() { return <ArchiveBoxArrowDownIcon />;}- Showing an archive or move-to-archive action in toolbars, list rows, or email and document UIs.
- Adding a subtle hover micro-interaction to a button or menu item that is meant to store or download content.
- Driving the animation from a parent component through a ref, for example when a whole row or card is hovered.
- Using a lightweight, theme-aware icon that follows text color and scales with a size prop.
Examples
Basic usage with size and color
Renders the icon at 32px. className is applied to the wrapper div, and the svg uses currentColor, so text color controls the stroke. The hover animation runs automatically.
import { ArchiveBoxArrowDownIcon } from "@/components/ui/archive-box-arrow-down";export default function Demo() { return <ArchiveBoxArrowDownIcon size={32} className="text-zinc-700 dark:text-zinc-200" />;}Controlled animation through a ref
Once a ref is attached, hover events on the icon itself no longer animate it. The parent button drives startAnimation and stopAnimation instead.
import { useRef } from "react";import { ArchiveBoxArrowDownIcon, type ArchiveBoxArrowDownIconHandle,} from "@/components/ui/archive-box-arrow-down";export default function ArchiveButton() { const iconRef = useRef<ArchiveBoxArrowDownIconHandle>(null); return ( <button type="button" onMouseEnter={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} className="inline-flex items-center gap-2" > <ArchiveBoxArrowDownIcon ref={iconRef} /> Archive </button> );}Meaningful icon with an accessible label
When the icon conveys meaning on its own, pass role and aria-label. These are forwarded to the wrapper div because the props are spread onto it.
import { ArchiveBoxArrowDownIcon } from "@/components/ui/archive-box-arrow-down";export default function ArchiveAction() { return <ArchiveBoxArrowDownIcon role="img" aria-label="Archive message" size={20} />;}API reference
Accessibility
- The component renders no text or title inside the svg. Use role="img" and aria-label on the icon when it carries meaning on its own.
- For purely decorative icons placed next to visible text, pass aria-hidden="true" so screen readers skip the wrapper.
- The animation is a visual hover effect only and conveys no information. Do not rely on it to communicate state.
- Icon color follows currentColor, so keep sufficient contrast against the background, and the icon is not a focusable control on its own. Put it inside a button or link that has an accessible name.
- The hover-based animation does not run on touch devices without hover; the icon remains fully visible and usable in its static state.
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.
Use the "archive-box-arrow-down" component (heroicons-animated/archive-box-arrow-down) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/archive-box-arrow-down2. 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, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ArchiveBoxArrowDownIcon } from "@/components/ui/archive-box-arrow-down";export default function Demo() { return <ArchiveBoxArrowDownIcon />;}```Files & dependencies
- archive-box-arrow-down.tsx