printer
An animated printer icon from the hugeicons-animated registry. On hover, a sheet of paper feeds in, passes through the rollers, and is ejected from the output tray, using a motion-driven SVG animation.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @hugeicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { PrinterIcon } from '@/components/ui/printer';export function Example() { return <PrinterIcon size={28} className='text-foreground' />;}- Use as a decorative or functional icon for print, export, or document output actions in toolbars, menus, and buttons.
- Use when a hover-triggered micro-interaction should signal that a print or document job is being processed.
- Use when you want an animated icon that can also be driven imperatively via a ref (startAnimation) for things like a print button click.
- Avoid in dense UIs where continuous or repeated motion would be distracting; the animation is one-shot per hover unless you call startAnimation again.
Examples
Basic hover animation
Renders the icon at the default 28px size. The animation plays on mouse enter.
import { PrinterIcon } from '@/components/ui/printer';export function BasicPrinter() { return <PrinterIcon />;}Imperative control via ref
Uses the PrinterIconHandle ref to start the animation programmatically, for example when a print job begins. Mouse hover no longer triggers the animation once a ref is attached.
import { useRef } from 'react';import { Button } from '@/components/ui/button';import { PrinterIcon, type PrinterIconHandle } from '@/components/ui/printer';export function PrintButton() { const iconRef = useRef<PrinterIconHandle>(null); return ( <Button variant='outline' onClick={() => iconRef.current?.startAnimation()} > <PrinterIcon ref={iconRef} size={18} /> Print </Button> );}Custom size and styling inside a menu item
Sets a smaller size and a muted color via className, and passes standard div attributes through to the wrapper.
import { PrinterIcon } from '@/components/ui/printer';export function PrintMenuItem() { return ( <div role='menuitem' className='flex items-center gap-2 text-sm'> <PrinterIcon size={16} className='text-muted-foreground' aria-hidden='true' /> <span>Print document</span> </div> );}Attaching mouse handlers
Passes onMouseEnter and onMouseLeave, which are called in addition to the built-in animation trigger.
import { PrinterIcon } from '@/components/ui/printer';export function TrackedPrinter() { return ( <PrinterIcon onMouseEnter={() => console.log('printer hovered')} onMouseLeave={() => console.log('printer left')} /> );}API reference
Accessibility
- The icon renders an SVG without a role or title, so it is treated as decorative by default; add aria-hidden='true' when a text label is present nearby.
- When the icon conveys meaning on its own, wrap it in an element with an accessible name (aria-label or visually hidden text) since the wrapper div has no role.
- The animation respects the user's reduced-motion preference via useReducedMotion; startAnimation does nothing when reduced motion is enabled.
- Because the animation is hover-only by default, keyboard users will not see it; pair it with a focusable button and call startAnimation from focus or click handlers if the motion matters.
- Icon color follows currentColor, so ensure sufficient contrast against the background in both light and dark themes.
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 "printer" component (hugeicons-animated/printer) from its shadcn registry.1. Install it with: npx shadcn@latest add @hugeicons-animated/printer2. 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 { PrinterIcon } from '@/components/ui/printer';export function Example() { return <PrinterIcon size={28} className='text-foreground' />;}```Files & dependencies
- icons/printer.tsx
- lib/use-icon-animation.ts