Workflow

WorkflowIcon is an animated SVG icon that draws three connected nodes (two squares linked by a rounded path) with a stroke-draw effect on hover. It is built on Motion and exposes an imperative ref for manual start and stop control.

Workflow
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/workflow.json

Usage

usage.tsx
import { WorkflowIcon } from "@/components/ui/workflow";export default function Example() {  return <WorkflowIcon size={28} />;}
  • Use it for workflow, automation, pipeline, or node-based feature labels, buttons, and navigation items.
  • Use it as a subtle hover-triggered affordance in settings, dashboards, or onboarding cards.
  • Use the ref handle when the parent should control the animation, for example during loading or on a timer.
  • Avoid it where a static icon is required, since the draw-in animation runs on every hover.

Examples

Basic hover icon

Uncontrolled usage. The icon animates on mouse enter and resets on mouse leave.

basic-hover-icon.tsx
import { WorkflowIcon } from "@/components/ui/workflow";export default function BasicExample() {  return (    <div className="flex items-center gap-2 text-foreground">      <WorkflowIcon />      <span>Automations</span>    </div>  );}

Controlled from a parent button

Attaching a ref switches the icon to controlled mode. Hover no longer triggers the built-in animation, so the parent calls startAnimation and stopAnimation.

controlled-from-a-parent-button.tsx
"use client";import { useRef } from "react";import { WorkflowIcon, type WorkflowIconHandle } from "@/components/ui/workflow";export default function ControlledExample() {  const iconRef = useRef<WorkflowIconHandle>(null);  return (    <button      type="button"      className="inline-flex items-center gap-2 rounded-md border px-3 py-2"      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}    >      <WorkflowIcon ref={iconRef} size={16} />      Build workflow    </button>  );}

Looping animation while loading

Plays the draw-in animation repeatedly through the imperative handle while a task is pending.

looping-animation-while-loading.tsx
"use client";import { useEffect, useRef } from "react";import { WorkflowIcon, type WorkflowIconHandle } from "@/components/ui/workflow";export default function LoadingExample({ isLoading }: { isLoading: boolean }) {  const iconRef = useRef<WorkflowIconHandle>(null);  useEffect(() => {    if (!isLoading) {      iconRef.current?.stopAnimation();      return;    }    iconRef.current?.startAnimation();    const id = setInterval(() => {      iconRef.current?.stopAnimation();      iconRef.current?.startAnimation();    }, 1200);    return () => clearInterval(id);  }, [isLoading]);  return <WorkflowIcon ref={iconRef} size={24} className="text-blue-600" />;}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. The viewBox stays 0 0 24 24.
classNamestring—Class names applied to the outer wrapper div, for example to set color with text utilities or margins.
refReact.Ref<WorkflowIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation(). Attaching it disables the built-in hover animation and makes onMouseEnter and onMouseLeave be called as plain handlers.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler from HTMLAttributes. It is called only when the ref is attached (controlled mode). Without a ref, the internal hover animation runs instead and this handler is not invoked.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler from HTMLAttributes. Behaves like onMouseEnter: called only in controlled mode (ref attached).
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, aria-*, data-*, etc.) are spread onto the wrapper div.

Accessibility

  • The SVG has no title, desc, or role. If the icon conveys meaning on its own, wrap it in an element with aria-label or add a visually hidden text label.
  • When the icon is decorative next to visible text, add aria-hidden="true" on WorkflowIcon (it is forwarded to the wrapper div) to keep screen readers from announcing it.
  • The animation is purely visual and carries no information. Consider respecting prefers-reduced-motion by avoiding automatic startAnimation loops for users who opt out.
  • Hover-only animation gives no feedback to keyboard or touch users. Pair it with a focus or label state if the icon is part of an interactive control.

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 "Workflow" component (lucide-animated/workflow) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/workflow.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, ref, onMouseEnter, onMouseLeave, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { WorkflowIcon } from "@/components/ui/workflow";export default function Example() {  return <WorkflowIcon size={28} />;}```

Files & dependencies

  • workflow.tsx
dependenciesmotion

Looks similar, elsewhere