file-01

File01Icon is an animated document icon: an outlined file with a folded corner and two text lines that flex on hover. It is a React component built on motion/react and can also be started programmatically through a ref.

file-01
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 @hugeicons-animated/file-01

Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { File01Icon } from '@/icons/file-01';export function Example() {  return <File01Icon />;}
  • Show a document, file, or attachment action in buttons, list rows, or file pickers where a subtle hover animation adds feedback.
  • Use as a decorative or affordance icon in navigation, file upload areas, or 'open document' CTAs.
  • Trigger the animation imperatively (for example when a related button is hovered) by passing a ref typed as File01IconHandle.
  • Choose this over static icons when a light, tactile hover reaction fits the interface, and avoid it where motion must be fully static.

Examples

Basic hover icon

Renders the default 28px icon that animates on mouse enter and resets on mouse leave.

basic-hover-icon.tsx
import { File01Icon } from '@/icons/file-01';export function BasicFileIcon() {  return <File01Icon />;}

Custom size and color

Sets a larger size and uses a Tailwind text color class, since the stroke is currentColor.

custom-size-and-color.tsx
import { File01Icon } from '@/icons/file-01';export function LargeBlueFileIcon() {  return <File01Icon size={40} className="text-blue-500" />;}

Imperative trigger from a button

Passes a ref typed as File01IconHandle so a parent button controls the animation. When a ref is attached, hovering the icon itself does not auto-play.

imperative-trigger-from-a-button.tsx
import { useRef } from 'react';import { File01Icon, type File01IconHandle } from '@/icons/file-01';export function OpenFileButton() {  const iconRef = useRef<File01IconHandle>(null);  return (    <button      type="button"      className="inline-flex items-center gap-2"      onMouseEnter={() => iconRef.current?.startAnimation()}    >      <File01Icon ref={iconRef} />      Open file    </button>  );}

Accessible labelled icon with extra handler

Uses standard div attributes such as role and aria-label, and an onMouseEnter callback that is called before the built-in animation starts.

accessible-labelled-icon-with-extra-handler.tsx
import { File01Icon } from '@/icons/file-01';export function LabelledFileIcon() {  return (    <File01Icon      role="img"      aria-label="Document"      onMouseEnter={() => console.log('file hovered')}    />  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24.
classNamestring—Class names applied to the wrapping div (inherited from HTMLAttributes<HTMLDivElement>). The SVG stroke uses currentColor, so set color through this class.
onMouseEnterMouseEventHandler<HTMLDivElement>—Called on mouse enter before the built-in start animation runs. Inherited from HTMLAttributes<HTMLDivElement>.
onMouseLeaveMouseEventHandler<HTMLDivElement>—Called on mouse leave before the built-in stop logic runs. Inherited from HTMLAttributes<HTMLDivElement>.
refRef<File01IconHandle>—Exposes startAnimation() and stopAnimation(). Attaching a ref switches the icon to controlled mode, so hover no longer auto-plays. stopAnimation only has an effect when the hook's loops option is true, which this icon does not set, so it is effectively a no-op here.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, role, aria-*, data-*, and so on) are spread onto the wrapping div.

Accessibility

  • The wrapping div has no role or label by default, and the SVG has no title or aria-hidden, so screen readers may announce nothing or unlabelled graphics. Add role='img' and aria-label when the icon conveys meaning, or aria-hidden='true' when it is decorative beside visible text.
  • The animation respects prefers-reduced-motion through useReducedMotion, so startAnimation returns early for users who prefer reduced motion.
  • Animation is triggered only by mouse enter, so keyboard-only users get no motion cue. Pair the icon with a focusable control and, when using the ref, call startAnimation from onFocus as well.
  • Keep the icon's visible text or accessible name on the parent control, since the icon itself is a graphic.
  • The animation is brief (about 0.6s) and small in amplitude, so it does not create a seizure or vestibular risk, but avoid relying on motion alone to communicate 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.

prompt.md
Use the "file-01" component (hugeicons-animated/file-01) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/file-012. 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 { File01Icon } from '@/icons/file-01';export function Example() {  return <File01Icon />;}```

Files & dependencies

  • icons/file-01.tsx
  • lib/use-icon-animation.ts
dependenciesmotion

Looks similar, elsewhere