Wind

WindIcon is an animated wind icon from lucide-animated that draws three curling wind lines in a staggered sequence on hover. It can also be controlled imperatively through a ref with startAnimation and stopAnimation.

Wind
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/wind.json

Usage

usage.tsx
import { WindIcon } from "@/components/ui/wind"; export default function Example() { return <WindIcon size={28} className="text-foreground" />; }
  • Use as a hover-animated weather or air-flow indicator, such as a wind speed or wind-condition label in a weather widget.
  • Use as a decorative, animated icon on feature cards, navigation items, or settings rows where a subtle motion reinforces the meaning.
  • Use when you need to start or stop the wind animation programmatically (for example while data is loading) via the forwarded ref.
  • Use in place of a static Lucide Wind icon when you want a lightweight, motion-based micro-interaction.

Examples

Default hover animation

Hovering the icon plays the built-in animation. No ref is passed, so the component manages its own mouse enter and leave handling.

default-hover-animation.tsx
import { WindIcon } from "@/components/ui/wind"; export default function Basic() { return <WindIcon />; }

Imperative control via ref

Passing a ref switches the component into controlled mode. Hover no longer triggers the built-in animation, and the parent calls startAnimation and stopAnimation directly.

imperative-control-via-ref.tsx
"use client"; import { useRef } from "react"; import { WindIcon, type WindIconHandle } from "@/components/ui/wind"; export default function Controlled() { const ref = useRef<WindIconHandle>(null); return (<button type="button" onMouseEnter={() => ref.current?.startAnimation()} onMouseLeave={() => ref.current?.stopAnimation()} className="inline-flex items-center gap-2 rounded-md border px-3 py-2"><WindIcon ref={ref} size={20} />Wind</button>); }

Custom size and color

Set size in pixels and use Tailwind text color classes, since the stroke inherits currentColor.

custom-size-and-color.tsx
import { WindIcon } from "@/components/ui/wind"; export default function Sized() { return <WindIcon size={40} className="text-sky-500" />; }

Weather widget row

Shows the icon beside a wind speed label inside a card, with standard div attributes forwarded to the wrapper.

weather-widget-row.tsx
import { WindIcon } from "@/components/ui/wind"; export default function WindRow() { return (<div className="flex items-center gap-3 p-4" aria-label="Wind speed 12 km/h"><WindIcon size={24} className="text-blue-500" /><span className="text-sm">12 km/h</span></div>); }

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the SVG in pixels. Applied to both the width and height attributes of the svg element.
classNamestring—Class names applied to the outer wrapper div through cn(className). Use it to set color, margins, and other styles.
refReact.Ref<WindIconHandle>—Forwarded ref exposing startAnimation() and stopAnimation(). Passing a ref disables the built-in hover animation, so the parent's onMouseEnter and onMouseLeave are called instead.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse enter. The built-in animate is started only when no ref is passed. When a ref is passed, this handler is invoked instead of animating.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Called on mouse leave. The built-in reset is run only when no ref is passed. When a ref is passed, this handler is invoked instead of resetting.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, aria-*, role, style, data-*, and so on) are spread onto the outer wrapper div, not the svg.

Accessibility

  • The component renders a div wrapper and an inline svg with no title, desc, or role. Screen readers may ignore it, so add role="img" and aria-label on the wrapper when the icon conveys meaning on its own.
  • If the icon is purely decorative next to visible text, set aria-hidden="true" on the component so it is skipped by assistive technology.
  • The animation is a hover micro-interaction with no focus trigger. Keyboard users will not see it unless a parent element handles focus and calls startAnimation through the ref.
  • Respect reduced-motion preferences by avoiding programmatic startAnimation calls when the user has requested reduced motion, for example with the prefers-reduced-motion media query.
  • Color comes from currentColor, so text color classes must meet WCAG contrast requirements against the background.

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

Files & dependencies

  • wind.tsx
dependenciesmotion

Looks similar, elsewhere